Find table of any number in C++ by R4R Team

-Here we find the mathematical table of the given integer number.

program:

#include< iostream>
#include< string.h>
int main()
{
int num,i;
cout<<"Enter number"<< endl;
cin>>num;
//table
cout<<"Table of "<< num<<"is"< endl;
for(i=1;i<=10;i++)
{
cout<< num<<" * "<< i<<" = "<< num*i<< endl;
}
}


output-

Enter number
3
Table of 3 is
3 * 1 = 3
3 * 2 = 6
3 * 3 = 9
3 * 4 = 12
3 * 5 = 15
3 * 6 = 18
3 * 7 = 21
3 * 8 = 24
3 * 9 = 27
3 * 10 = 30

-In this program, we just take an input of the integer number and store in num variable.
-We run for loop 10 times to get all multiple of input value.
-And display that table.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!