//program to understand assignment operator with contracted/condensed approach
#include <iostream> //header file
using namespace std;//to handle all standard characters/functions,reserved words used in program. we do not use in turboc++ compiler.
int main() //main function
{
int a; //declaration
a=56; //value assignment
cout << "the value of a=" <<a<< endl;//prints the value
a+=4; //condensed method. it means a=a+4.
cout<<"after adding 4 to 56, it is "<<a;// prints the value after adding 4.
return 0;
}
#include <iostream> //header file
using namespace std;//to handle all standard characters/functions,reserved words used in program. we do not use in turboc++ compiler.
int main() //main function
{
int a; //declaration
a=56; //value assignment
cout << "the value of a=" <<a<< endl;//prints the value
a+=4; //condensed method. it means a=a+4.
cout<<"after adding 4 to 56, it is "<<a;// prints the value after adding 4.
return 0;
}
No comments:
Post a Comment