0
#include <stdio.h> int main() { int i=3; if(!i) i++; i++; if(i==3) i+=2; i+=2; printf("%d",i); return 0; }
How 6 I think 7?
4 Antworten
+ 4
int i=3;
Here value of i is 3 in next line if condition will run here (! ) this is not operator so if(!3) it means 0 so condition will be false so first i++ won't be work after that next
i++ will run here value will increase and it will be 4 in next line there is if case so if(4==3) which is false so next line will not work then next line i+=2 this will run it means i=i+2 where i was 4 so i=4+2=6
printf("%d",i);
And printf will print 6
+ 1
Indentation or the brakets or a little of both.
https://code.sololearn.com/c5Ll0nFUSq6V/?ref=app
0
Thanx a lot I know the concept but get confused