+ 1
Still having problems in for loop Nd postfix/prefix,is there any easy way to understand?
3 Antworten
0
what is the problem with postfix and prefix operator???
Prefix increments the value, and then proceeds with the expression.
Postfix evaluates the expression and then performs the incrementing
For e.g.
for prefix operator
int z= (++i); // given i is 5
Sopln(z); // value z is now 6
for postfix operator
int z= (i++); // given i is 5
Sopln(z); // value z is now 5 after again u wll use with d same variable name i it wll print 6
Another e.g.
int a= (++i)+(i++)+(++i); // given i = 5
Sopln(a); // ans wll print 8 bcz firstly der is prefic so it wll increase d value by 1 so it store 6 den further when we go to next step der is postfix operator so it wll print same value bcz postfic increase d value in next step n again when we go to i der is prefix operator so it wll print 7 and before step we use postfix operator so further it wll inrease by one so ans coming 8
// hope u get it ur problem
0
Harsh Agrawal Is there any easier way to understand the for loop in multi-dimensional array?
0
Sorry Apoorv singh I dont know much about array!!!!!😓