for loop: A Multiplication Table : For « Language « C++





for loop: A Multiplication Table

for loop: A Multiplication Table
#include<iostream>
using namespace std;

int main(void)
{
     cout << "A multiplication table:" << endl
          << "  1\t2\t3\t4\t5\t6\t7\t8\t9" << endl
          << "" << endl;
     for(int c = 1; c < 10; c++)
     {
          cout << c << "| ";
          for(int i = 1; i < 10; i++)
          {
          cout << i * c << '\t';
          }
          cout << endl;
     }
     return 0;
}

           
       










Related examples in the same category

1.For loop with int value type as the controlFor loop with int value type as the control
2.For statementFor statement
3.Generating digit numbers of equally total digits