Why the output is 14? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
2nd May 2023, 9:38 AM
Abhishek Bhatia
Abhishek Bhatia - avatar
3 Answers
+ 6
Learn increment and decrement operators in C, you can easily get it .
2nd May 2023, 10:00 AM
Sakshi
Sakshi - avatar
+ 5
Increment, types: pre-increment (++a) increases a before doing the operations in this line. post-increment (a++) increases a after doing the operations in this line. Examples: int a = 2; int b = a++; // b = 2 //INCREASE A VALUE int c = a; // c = 3 ————————————- int a = 2; int b = ++a; // b = 3 (increases a’s value before doing the operatiospns int c = a; // c = 3 Hope this helps
2nd May 2023, 10:49 AM
Ugulberto Sánchez
Ugulberto Sánchez - avatar
0
My answer is 13 but the compiler is giving 14
2nd May 2023, 10:43 AM
Abhishek Bhatia
Abhishek Bhatia - avatar