Multiplication Tables in C++
Loop is a sequence of repetitive execution and terminated upon the met condition.
<br />
Learning C++ Creating Multiplication Table<br />
Repetition are widely common on creating a program
We will create a multiplication table using while() loop
Example of this program is function for(),do{}while(),while(){}
syntax
To create a multiplication table type the code below
syntax
To create a multiplication table type the code below
Repetition are widely common on creating a program
We will create a multiplication table using while() loop
- #include<iostream>
- #include<conio.h>
- using namespace std;
- int main()
- {
- int limit,x,y;
- cout << "MULTIPLICATION TALBE"<<endl<<endl;
- cout << "0\t";
- limit=8;
- for(x=1;x<=limit;x++){cout << x << "\t";}
- cout << endl;
- for(y=1;y<=limit;y++)
- {
- cout <<y;
- for(x=1;x<=limit;x++)
- {
- cout<<"\t"<<x*y;
- }
- cout << endl;
- }
- getch();
- }
Comments
Post a Comment