[C++ Program] Table of Number entered by user! (For Loop)

Leave a Comment
Write a program to accept number from user and display table of that number.

Following program is created for old compiler. If you are using new compiler then you need change few part of header file.

Program:

#include<iostream.h>

#include<conio.h>



void main()

{

    int num,multi,i;

    clrscr();

   

    cout<<"Enter Number=";

    cin>>num;

   

    for(i=1;i<=10;i++)

    {

        multi=num*i;

        cout<<"\n"<<num<<"*"<<i<<"="<<multi;

    }

    getch();

}

Output:

Enter Number=7

7*1=7
7*2=14
7*3=21
7*4=28
7*5=35
7*6=42
7*7=49
7*8=56
7*9=63
7*10=70
If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment