Q:

C++ Program To Print A Table Using For Loop

belongs to collection: Loop Programs In C ++Programming

0

Write C++ A Program To Print A Table Of Given Number Using For Loop

Logic :- Take A for loop and initialize with number you taken from user and put a condition that number multiply with 10 and in last condition increase a number by number see below


Syntax :- 
for(=number;i<=number*10;i=i+number)
cout<<i;

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include<iostream>
using namespace std;
int main()
{
    int i,num;
    
    cout<<"Enter Any Number To Print Table \n";
    cin>>num;
    
    for(i=num;i<=10*num;i=i+num)
    {
        cout<<i<<endl;
    }
    return 0;

}

 

Output:

Enter Any Number To Print Table 

10

10

20

30

40

50

60

70

80

90

100

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Program To Print A Reverse Number Using Loop... >>
<< C++ Program To Print A Message Multiple Times...