Can anyone help me convert this code into a nested while loop? i'm having trouble and I need to get this done by tomorrow :I

#include <iostream>
void main ()
{
int b=5;

for(int i=1;i<=b;i++)
{
for(int l=1;l<=i;l++)
{
cout<<b;
b--;
}
cout<<endl;
b=5;
}

cin.get();
cin.get();
}
ALWAYS use int main().

You also need to use either:
1
2
3
using std::cout; 
using std::endl; 
using std::cin; 


OR just prefix standard to all calls to these each time you use them e.g.
 
std::cout << b; 


<-- Take a look at the reference over that way <--- for (lol) how to do a while loop.

Also in future, please use code tags and indentation.
Topic archived. No new replies allowed.