Is there anyone who can tell me how this can be "33" | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is there anyone who can tell me how this can be "33"

Int a = 1; a++; cout<<++a;

17th Feb 2017, 9:07 PM
Noorulhaq
Noorulhaq - avatar
3 Answers
+ 1
Your code don't never output "33"... Your code raise an syntax error for the upper case I of 'Int', which should be 'int' ( all in lower case )... And even when corrected, your code output "3", as expected...
18th Feb 2017, 7:51 AM
visph
visph - avatar
+ 1
#include <iostream> using namespace std; int a = 1; int main() { a = a+32; cout<<a; return 0; } You need to modify the a integer inside of main. This is one way to get it to 33
18th Feb 2017, 12:01 PM
Orfeo Terkuci
Orfeo Terkuci - avatar
17th Feb 2017, 9:13 PM
Mario L.
Mario L. - avatar