I'm new to the C ++ language and I have a problem with this cycle.
#include<iostream>
using namespace std;
int main(){
int iterador=0;
while (iterador<=10){
cout<<iterador<<endl;
iterador+=1;
cout<<"si";
}
}
It is supposed to print the numbers from 0 to 10 and then print something (I put "yes" to confuse) but when you execute it, it prints it to me in the following way:
0
si1
si2
si3
si4
si5
si6
si7
si8
si9
si1
si
and what I wanted was this!
0
1
2
3
4
5
6
7
8
9
1
si
Can someone explain to me why C ++ does this, because it does so or how does C ++ work with cycles?
Thank you!