Math Tables using C++ Programming Language

Math Tables:


Explanation of Program code:



The first thing you should for is to include the library files like iostream or iostream.h in older versions.These files are necessary for in order to go for input and output streams in program code. By Input and output streams i mean cout and cin. Cout is for output stream and Cin is for input stream.Similarly you also have to add conio.h or if you don't want to use this file you can go for return 0; statement at the end of program code.

Recommended Article:

Recommended Article: Read this article to understand why i used this loop. It is just to avoid again and again execution or compling of program code in order to solve area of different triangles.It is not necessary,if you don't want to use it remove it.
Also Read This.

Program Code:

#include<iostream>
using namespace std;

int main()
{
int z,t;
char redo;
do
{
cout<<"Enter Range or how many mathematical tables do you want =   ";
cin>>z;

for(int i = 0;i<=z;i++)
{
for(int j = 0; j<=10; j++)
{
t = i*j;
   cout<< i <<"*"<< j <<"="<< t<< " " ;
}
cout<<endl<<endl;
}
cout<<"**********************************************************************************************"<<endl;
cout<<"Enter y for next calculation =  ";
cin>>redo;
cout<<endl<<endl;
}while( redo == 'y' || redo == 'Y');
return 0;
}

Output:

Output


No comments:

Post a Comment

Please disable your ad blocker to support this website.

Our website relies on revenue from ads to keep providing free content.