c programming 4 - row2=val[1[0 val[1[1 val[1[2 val[1[3...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <stdio.h> int main() { #define NUMROWS 5 #define NUMCOLS 5 int val[NUMROWS] [NUMCOLS] = {8,3,9,0,10,3,5,17,1,1,2,8,6,23,1,15,7,3,2,9,6,14,2,6,0}; int row1, row2, row3, row4, row5, col1, col2, col3, col4, col5; printf("Enter Row 1: %d %d %d %d %d", val[0][0], val[0][1], val[0][2], val[0][3], val[0][4]); printf("\nEnter Row 2: %d %d %d %d %d", val[1][0], val[1][1], val[1][2], val[1][3], val[1][4]); printf("\nEnter Row 3: %d %d %d %d %d", val[2][0], val[2][1], val[2][2], val[2][3], val[2][4]); printf("\nEnter Row 4: %d %d %d %d %d", val[3][0], val[3][1], val[3][2], val[3][3], val[3][4]); printf("\nEnter Row 5: %d %d %d %d %d\n", val[4][0], val[4][1], val[4][2], val[4][3], val[4][4]); row1=val[0][0]+val[0][1]+val[0][2]+val[0][3]+val[0][4];
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: row2=val[1][0]+val[1][1]+val[1][2]+val[1][3]+val[1][4] row3=val[2][0]+val[2][1]+val[2][2]+val[2][3]+val[2][4] row4=val[3][0]+val[3][1]+val[3][2]+val[3][3]+val[3][4] row5=val[4][0]+val[4][1]+val[4][2]+val[4][3]+val[4][4] printf("Row totals: %d, %d, %d, %d, %d", row1, row2, row3, row4, row5) col1=val[0][0]+val[1][0]+val[2][0]+val[3][0]+val[4][0] col2=val[0][1]+val[1][1]+val[2][1]+val[3][1]+val[4][1] col3=val[0][2]+val[1][2]+val[2][2]+val[3][2]+val[4][2] col4=val[0][3]+val[1][3]+val[2][3]+val[3][3]+val[4][3] col5=val[0][4]+val[1][4]+val[2][4]+val[3][4]+val[4][4] printf("\nColum totals: %d, %d, %d, %d, %d\n", col1, col2, col3, col4, col5) system("PAUSE") return 0 }...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern