Find the Output of the Given Code Which has Pre-Increment Operator
a=13; cout<<++a+++a+++a; What will be the output of the given code and how?
Answers
Answered by
0
a = 13 ;
cout << (++a) + (++a) + (++a) ;
The value of a is incremented by 1 before adding..
so 14, 15, 16 are added and so 45 is printed.
cout << (++a) + (++a) + (++a) ;
The value of a is incremented by 1 before adding..
so 14, 15, 16 are added and so 45 is printed.
Similar questions