Saturday 21 July 2012

Lecture: 117


                                                Lecture 117

// Loop do 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;
    do
    {
      cout<<"\n"<<tnum<<" X "<<n<<" = "<<tnum*n;
      n++;
    }while(n<=ed);
  getch();
  return 0;
}

Code view in dev compiler:

Compile the program Ctrl+F9

      Run program Ctrl+F10