Multiplication Table (10 x 10)

Thursday, September 12, 2013 0 Comments A+ a-

C++ program for Multiplication table (10 x 10)


Problem:
Write a multiplication table ( 10 x 10)
The following program shows a 10 x 10 multiplication table.
It uses the escape sequence for horizontal tab (\t) to properly align the table.

/*
Multiplication Table (10 * 10)
*/
#include <iostream>

using namespace std;

int main(void)
{
 int x,y;
 char waitInput;

 for(x=1; x<=10; x++)
 {
  for(y=1; y<=10; y++)
  {
   //use horizontal tab (\t) to align properly
   cout << "\t" << (x*y);
  }

  //newlines
  cout<<endl<<endl;
 }

 cin>>waitInput;
 return 0;
}