nested for loops - multiplication table
It is for your benefit
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
// Q(2) - (18 marks)
// nested for loops - multiplication table (1 to 5)
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
for (int i=1 ; i<=5 ; i++)
{
cout<<" Multiplication table of "<<i<<":"<<endl;
for (int j=1 ; j<=10 ; j++)
cout<<i<<"X"<<j<<"="<<(i*j)<<endl;
}
system("PAUSE");
return 0;
}
|
Topic archived. No new replies allowed.