Screnshoot Matrik Penjumlahan
Coding Matrik Penjumlahan
#include
main()
{
int s[3][3];
int q[3][1];
s[0][0]= 4; s[0][1]= 2; s[0][2]= 7;
s[1][0]= 5; s[1][1]= 8; s[1][2]= 1;
s[2][0]= 3; s[2][1]= 6; s[2][2]= 2;
q[0][0]=s[0][0]+s[0][1]+s[0][2];
q[1][0]=s[1][0]+s[1][1]+s[1][2];
q[2][0]=s[2][0]+s[2][1]+s[2][2];
printf (" | %d ",s[0][0]); printf(" %d ",s[0][1]); printf(" %d | ",s[0][2]); printf (" | %d |\n",q[0][0]);
printf (" | |"); printf (" | |\n");
printf (" S | %d ",s[1][0]); printf(" %d ",s[1][1]); printf(" %d | ",s[1][2]); printf("Q =>"); printf (" | %d | \n",q[1][0]);
printf (" | |"); printf (" | |\n");
printf (" | %d ",s[2][0]); printf(" %d ",s[2][1]); printf(" %d | ",s[2][2]); printf (" | %d |\n",q[2][0]);
}
Post a Comment
1. Jangan lupa tinggalkan Likenya ya
2. Berkomentarlah dengan baik dan sopan