0

Why it didnt output 43 ? Eventhough a++ is coded ?

24th Mar 2019, 3:43 PM
Mosh Maltosh
6 Réponses
+ 3
Can you show us your code, please?
24th Mar 2019, 6:37 PM
Denise Roßberg
Denise Roßberg - avatar
+ 2
Do{ print a --> output: 42 a++; --> a = 43 }while(a < 5) --> 43 < 5: false --> stop the loop do{ a++; cout << a }while(a < 5); //output 43
24th Mar 2019, 8:01 PM
Denise Roßberg
Denise Roßberg - avatar
+ 2
Thank you very much
25th Mar 2019, 7:00 AM
Mosh Maltosh
0
Sorry I thought that you can see the part of the lesson that im asking about
24th Mar 2019, 7:44 PM
Mosh Maltosh
0
int a = 42; do { cout << a << endl; a++; } while(a < 5); // Outputs 42
24th Mar 2019, 7:46 PM
Mosh Maltosh