+ 2
I don't understand about increments
4 Respuestas
+ 6
First method
int a=0;
a++;
cout<<a; //output:1
Second method
int a=0;
cout<<++a; //output:1
+ 5
increments & decrements are the changing of an existing variable value by adding or subtracting a number to that value ..
consider the following :
int var = 1 ;
var++;
cout<<var;
var -= 2
cout<<var;
in the first cout statement it should output 2..
in the second cout it should output -1..
+ 1
There are two things increment and decrement.....
increment is like a++; which is equal to a=a+1;
decrement is like a--; which is equal to a=a-1;
+ 1
tnx