+ 2
what is the difference between (a++) and (++a) ?
5 Answers
+ 12
a++ is post increment. which means it evaluates first then increments the value.
Ex: int x=2,y;
y=x++;
//now x=3 and y=2.
++a is pre increment which means it increments first then evaluates.
Ex: int x=2,y;
y=++x;
//now x=3 and y=3.
+ 2
a++ is post-increment
++a is pre-increment
a=3;
console.write("statement print {0}{1}",a++,++a);
output 3 4
+ 1
@Santhosh thanks
+ 1
As its name suggests in post increments value will be used first than value will be incremented by one bt in preincrement value will be first incremented and then used..
x++(i. E value+1);
++x(i. e 1+value).;
0
Can any explain this program to me
int a = 10, b = 10;
printf("__a= %d ",__a);
printf(b__= % d", b__);
out put is
__a = 10
b__= 11
how please help me