Need this done in C. Problem: Write a program that asks the user to enter number
ID: 3652851 • Letter: N
Question
Need this done in C. Problem: Write a program that asks the user to enter number 1-16 in any order, and then display those numbers in a 4*4 arrangement. At last, it calculates the sums of each row, column and both diagonals. You can use 16 variables to store all the input value. What I have so far (Cant seem to figure out how to add the different integers together): #include #include #include #include int main (void) { int num1, num2, num3, num4, num5, num6, num7, num8, num9, num10, num11, num12, num13, num14, num15, num16; int sum_rows=0; printf ( "Enter number 1-16 in any order: "); printf(" "); scanf ( "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", &num1, &num2, &num3, &num4, &num5, &num6, &num7, &num8, &num9, &num10, &num11, &num12, &num13, &num14, &num15, &num16); sum_rows=num1+num2; printf(" "); printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d",num1,num2,num3,num4,num5,num6,num7,num8,num9,num10,num11,num12,num13,num14,num15,num16); printf(" "); printf ( " --------------------"); printf ( " Row Sums "); printf ( "-------------------- "); printf ( "Row 1:",sum_rows); system("pause"); return 0; }Explanation / Answer
#include#include void main() { int num[4][4]; int i,j,sum; printf(" Enter any 16 numbers :"); for(i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.