Pre-increment and post increment the
Pre-increment
it means that first the value will increment by 1 and the store in variable. for example:-
x=5;
y=++x;
now what will be the value of x and y. the value of y will be 6 and also the value of x will be 6.
Post-increment
It means that first the value will be store(print) in variable and then update by 1. for Example:-
x=5;
y=x++;
now what will be the value of x and y. the value of y is 5 because it first store in variable y. after it the value is update and the value of x is 6.
To get the video of Pre-increment and post-increment please click the link given blow
Comments
Post a Comment