0

uhm sir... the program must be like this...
(<<snip>>..awwwhelp me plsss

the rows and columns must input numbers manually

...and the result will be like multiplication table...

the outcome must be like this:
number of rows?: 5
number of columns: 6

input rows: 2 3 5 1 0
input columns: 1 5 7 8 2 3

1 5 7 8 2 3
2 2 10 14 16 4 6
3 3 15 21 24 6 9
5 5 25 35 40 10 15
1 1 5 7 8 2 3
0 0 0 0 0 0 0

Edited by Nick Evan: URL removed

4
Contributors
8
Replies
9
Views
6 Years
Discussion Span
Last Post by civirol02
0

uhm sir... the program must be like this...
(<<snip>>..awwwhelp me plsss

the rows and columns must input numbers manually

...and the result will be like multiplication table...

the outcome must be like this:
number of rows?: 5
number of columns: 6

input rows: 2 3 5 1 0
input columns: 1 5 7 8 2 3

1 5 7 8 2 3
2 2 10 14 16 4 6
3 3 15 21 24 6 9
5 5 25 35 40 10 15
1 1 5 7 8 2 3
0 0 0 0 0 0 0

ive edited it...its like multiplication table

0

have you made any attempts at all to write/code that program? If you have then post what you have done so far. We don't do homework but we will answer specfic questions you might have about it.

0

uhm sir... the program must be like this...
(<<snip>>..awwwhelp me plsss

the rows and columns must input numbers manually

...and the result will be like multiplication table...

the outcome must be like this:
number of rows?: 5
number of columns: 6

input rows: 2 3 5 1 0
input columns: 1 5 7 8 2 3

1 5 7 8 2 3
2 2 10 14 16 4 6
3 3 15 21 24 6 9
5 5 25 35 40 10 15
1 1 5 7 8 2 3
0 0 0 0 0 0 0

ive doin it but my problem is how a variable have a noumerous values in it???

0

Something like this should get you started... just a hint.

int matrix[6][6];
int cols[6], rows[6];

cols[0] = rows[0] = matrix[0][0] = 0;	//Corner of Matrix

....

//Populate multiplication table
for (int i = 1; i <= 5; i++)
{
	matrix[0][i] = cols[i];
	matrix[i][0] = rows[i];

	for (int j = 1; j <= 5; j++)
	{
		matrix[i][j] = rows[j] * cols[i];
	}
}

I'll go ahead and give you this part too.

//Output the table
for (int i = 0 ; i <= 5 ; i++)
{
	for (int j = 0 ; j <= 5 ; j++)
		cout << matrix[i][j] << "\t";

	cout << endl ;
}

Edited by Duki: n/a

0
using namespace std;
 int main() {

 int i,j,k,l;


cout<<"input #rows:";
cin>>k;
cout<<"input #columns:";
cin>>l;
 cout << setw(5)   << " ";
 for(i=1; i<=k; i++) {

 }
 cout << endl;

 for(i=1; i<=k; i++) {


 for(j=1; j<=l; j++) {
 cout << setw(5) <<  i*j;
 }
 cout << endl;
 }


 return 0;
       
		return 0;
		}

return 0;
ive on this part already....hehehe...any one can change it and the multiplicands can be encode manually...

like
enter the numbers here(rows): 0 8 6 5 thanks

0

This is th same problem I am trying to solve. What is the use of matrix?

Edited by civirol02: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.