Answer this question | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Answer this question

int a=2 printf("%d",a++ - ++a);

18th Dec 2018, 12:34 PM
Rajasekhar Reddy
Rajasekhar Reddy - avatar
4 Respuestas
+ 2
1. Firstly, you should separate the two statements by ; int a = 2; printf("%d, a++ - ++a) ; 2. The increment works like this ++a is increment before using. a++ is using before increment. 3. Because a is 2, a++ is 2, and a becomes 3 4. Because a is 3, ++a is 4, and a becomes 4 So a++ - ++a is 2 - 4, Output - 2
18th Dec 2018, 12:43 PM
Gordon
Gordon - avatar
+ 2
Please use relevant tags though. Like C, printf, a++
18th Dec 2018, 1:40 PM
Matthias
Matthias - avatar
0
The answer is -2! I think it's not a problem!! This Q&A discussions section is only for programming related problems and questions and you can ask that here!! And your question related tutorial of SoloLearn! https://www.sololearn.com/learn/C/2917/?ref=app By the way, you can suggest this a quiz in the quiz factory of SoloLearn!
18th Dec 2018, 12:41 PM
AL Araf
AL Araf - avatar