Monday, July 27, 2009

How to set rows and columns in c++ program?...what was the code in making a multiplication table?

You need a two dimensional array:





int *multiplicationTable = new int[10][10];





Then you could populate it like this:





for (int i = 0; i %26lt; 10; i++)


for(int j = 0; j %26lt; 10; j++)


multiplicationTable[i][j] = i * j;


No comments:

Post a Comment