0

What is the logic behind this code to find output?

int x=1,i; for (i=1;i<4; i++) { x+=i; } cout<<i;

3rd Sep 2020, 7:54 PM
Suparna Podder
Suparna Podder - avatar
8 odpowiedzi
0
"For" , "Int" and "Cout" are wrong. These should be "for" and "int" and "cout".
3rd Sep 2020, 8:03 PM
Ivan
0
When you declare a variable x, then use this, not X.
3rd Sep 2020, 8:05 PM
Ivan
0
Ivan l konw sry it's keypad mistake. Can you tell me output process ? I slove but didn't matching the answer
3rd Sep 2020, 8:05 PM
Suparna Podder
Suparna Podder - avatar
0
~ swim ~ l solve but l'm not getting right output
3rd Sep 2020, 8:11 PM
Suparna Podder
Suparna Podder - avatar
0
~ swim ~ 4 right? Plz explain correct output?
3rd Sep 2020, 9:22 PM
Suparna Podder
Suparna Podder - avatar