C++ program to print a table of input number using for loop

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int x,i,y;
cout<<"Enter number you want to print table:- ";
cin>>x;
for(i=1;i<=10;i++)
 {
  y=x*i;
  cout<<x<<" * "<<i<<" = "<<y<<endl;
 }
getch();
}

OUTPUT:-

scanfcode

Leave a Reply

Your email address will not be published. Required fields are marked *