Lecture 92
// Loop while
#include <iostream>
#include <conio.h>
using namespace std;
main ()
{
int n,tnum,st,ed;
cout<<"Enter the table number: ";
cin>>tnum;
cout<<"Enter the start table number: ";
cin>>st;
cout<<"Enter the end table number: ";
cin>>ed;
n=st;
while(n<=ed)
{
cout<<"\n"<<tnum<<" X
"<<n<<" = "<<tnum*n;
n++;
}
getch();
return 0;
}
Code view in dev compiler:
Compile the program Ctrl+F9
Run program Ctrl+F10