Advertisement Area

Program #9: To Print Table of Number using For Loop

C++ Language

#include<iostream.h>
#include<conio.h>
void main()
{
    int num,result,i;
    clrscr();
    cout<<"Enter a Number - ";
    cin>>num;
    for(i=1;i<=10;i++)
    {
        cout<<num<<"*"<<"="<<num*i<<endl;
    }
    getch();
}

/*OUTPUT*/
Enter a Number - 2
2*=2
2*=4
2*=6
2*=8
2*=10
2*=12
2*=14
2*=16
2*=18
2*=20