Affiliates


Multiplication Tables in C++

Loop is a sequence of repetitive execution and terminated upon the met condition.
Example of this program is function for(),do{}while(),while(){}

syntax
To create a multiplication table type the code below





<br /> Learning C++ Creating Multiplication Table<br />






Repetition are widely common on creating a program

We will create a multiplication table using while() loop

  1. #include<iostream>
  2. #include<conio.h>
  3. using namespace std;
  4. int main()
  5. {
  6.     int limit,x,y;
  7.     cout << "MULTIPLICATION TALBE"<<endl<<endl;
  8.     cout << "0\t";
  9.     limit=8;
  10.     for(x=1;x<=limit;x++){cout << x << "\t";}
  11.     cout << endl;
  12.     for(y=1;y<=limit;y++)
  13.     {
  14.         cout <<y;
  15.         for(x=1;x<=limit;x++)
  16.         {
  17.             cout<<"\t"<<x*y;
  18.         }
  19.         cout << endl;
  20.     }
  21.     getch();
  22. }


Comments

Popular posts from this blog

Fixed by using cmd: USB drive unusable, unformattable, and reporting 0 bytes capacity

A Love of a brother