What should be the output of below program?
int main()
{
int a=10;
cout<<a++;
return 0;
}
Answers
Answered by
6
Answered by
4
The mentioned programming lines are in C plus plus programming language so the output of the mentioned segment of the program is '10'.
Detailed Explanation:
- The variable 'a' is declared as the integer data type and its assigned value is 10.
- But before the value is increased by 1, the initial value is displayed because the operator which is used here is postfix increment operator.
- The value is displayed in the first place by using the postfix increment operator which means the initial value of the variable 'a' is displayed first and then the given variable which is 'a' is increased by 1.
OUTPUT:
10
Similar questions