0
Can anyone explain this why the number does not increase in the loop?
for(int x=0;x=10;x++) {cout<<x;}
2 Answers
+ 1
In your condition you are setting x to equal 10 not testing it. Try something that says less than or equal to.
+ 1
Try x!=10
for loop syntax
for(initialize variable ; while variable isnt some condition ; update variable ) {
Repeat this code
}
Conditions
== !=
< <=
> >=