How to create a 4x4 matrix in programming

label Programming
account_circle Unassigned
schedule 1 Day
account_balance_wallet $5

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

Did you know? You can earn $20 for every friend you invite to Studypool!
Click here to
Refer a Friend
...
Oct 3rd, 2015
...
Oct 3rd, 2015
Oct 19th, 2017
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