Lecture 125
// Loop do while
//Nested for
loop
#include
<iostream>
#include
<conio.h>
using
namespace std;
main ()
{
int row,col;
row=1;
do
{
col=1;
do
{
cout<<"Outer = "
<< row <<" Inner = "<<col<<endl;
col++;
}while(col<3);//inner loop
cout<<endl;
row++;
}while(row<3);//outer loop
getch();
return 0;
}
Code view in dev compiler:
Compile the program Ctrl+F9
Run program Ctrl+F10