0
difference of x++ and ++x
What is difference between x++ and ++x?
4 Answers
+ 4
keep it simple ++x is prefix and x++ is postfix
+ 1
++x will increment the value of x before it is called while x++ will increment it after for example
int x=6;
cout <<x++<<endl;
cout <<x <<endl;
this will output:
6
7
+ 1
Let a=1
Cout<<++a;
Cout<<a;
The output will be 2. 2.
Now
Cout<<a++;
Cout<<a;
The output is. 1. 2.
- 2
He asked explanation not full form



