0

What will be the output and how??

#include<iostream> int main(){ int a=10; cout<<a<<a++<<++a; return 0; }

18th Sep 2018, 11:33 AM
Harshit Mittal
Harshit Mittal - avatar
1 Answer
+ 5
Output: 101012 First step: prints 'a' so basically it's '10' Second step: prints 'a' and after that increases it by 1 so it prints '10' too Third step: increases 'a' by 1, then prints 'a', but now a is 12
18th Sep 2018, 11:49 AM
Aleksander Szczepura
Aleksander Szczepura - avatar