assignment 4 - /*Assignment4,PartA,Question1)*/...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/* Assignment 4, Part A, Question 1) */ #include <stdio.h> #define ROWS 5 #define COLS 5 int main() { int rowsum, colsum, n, i; int nums[ROWS][COLS] = {{8,3,9,0,10},         {8,5,17,1,1},                    {2,8,6,23,1},       {15,7,3,2,9}, {6,14,2,6,0}}; for(n = 0; n < 5; n++) printf("\nRow %d : %d, %d, %d, %d, %d\n", n, nums[n][0], nums[n][1],  nums[n][2], nums[n][3], nums[n][4]);   for(n = 0; n <5; n++)     rowsum = nums[n][0] +nums[n][1] +nums[n][2] +nums[n][3] +nums[n][4],   printf("\nTotal of Row %d is: %d", n, rowsum);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

assignment 4 - /*Assignment4,PartA,Question1)*/...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online