while in while loop


#include<iostream>

using namespace std;

int main()
{
int a=0;
int b=0;

while (a < 10){
a++;

while (b<10)
{
b++;

}
cout<<b;
}
}






how this loop will execute?????????????
What do you mean?
inner while loop will run once only and outer loop will run 10 times printing b==10 , 10 times.

Output would be

10101010101010101010
Topic archived. No new replies allowed.