Program to print table by for 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;
for(int i=1;i<=10;i++)
{
cout<< n <<"*" << i <<"="<<n*i<<endl;
}
getch();
}

Output:-


Post a Comment

0 Comments