Program to print table by While loop.

Program:-

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n;
cout<<"\nEnter the number to print the table";
cin>>n;  // table to print
cout<<endl;
int i =1;
while(i<=10)
{
cout<< n <<"*" << i <<"="<<n*i<<endl;
i++;
}
getch();
}

Output:-


Post a Comment

0 Comments