[prog] C++ and arrays

wolf wolf at wolfrising.net
Sun Jul 4 16:09:54 EST 2004


This is a simple little program to print a multiplication table, what 
I'm wondering
is there a way to write this same program using arrays? Thanks!

#include <iostream>
#include <iomanip>

using namespace std;

int main()

{

     for (int i = 1; i <= 12; i++)

{

     for (int j = 1; j <= 12; j++)

         cout << setw(4)<<j*i << setw(4) ;

cout << endl;

}

  return 0;

}



More information about the Programming mailing list