How to create a 4x4 matrix in programming

Programming
Tutor: None Selected Time limit: 1 Day

Hello, how do I create a 4x4 matrix with numbers 1<16 ?

Oct 3rd, 2015

Thank you for the opportunity to help you with your question!

To create a matrix with 4*4 on programming should you use an 2 dimension  array : 

exemple in C++  ; 

 int  Matrix[4][4];


to full this matrix you need to use a loop like : 

for(int i=0;i<4;i++){

   for(int j=0;j<4;j++){

printf("put number < 16 : ");

scanf("%d",&Matrix[i][j]);

}

}


if you want to show this matrix you can use this code : 


for(int i=0;i<4;i++){

   for(int j=0;j<4;j++){

printf(Matrix[i][j]);

}

}



========

if you don't understand something please just ask 

Each time you have any other assignment or question just invite me i will give you the best answer 


Good Luck

Please let me know if you need any clarification. I'm always happy to answer your questions.
Sep 21st, 2015

Are you studying on the go? Check out our FREE app and post questions on the fly!
Download on the
App Store
...
Oct 3rd, 2015
...
Oct 3rd, 2015
Dec 7th, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer