Commit 522fa840 by rallui

Upload New File

parent 8474d67f
Showing with 50 additions and 0 deletions
#include <stdio.h>
#include <stdio.h>
#define n 4
#define m 3
int main(void)
{
int i, j;
int negsum;
int B[n][m]={
{-2,-3,5},
{5,6,-5},
{11,-2,-3},
{-12,-4,5}
};
while (i < n)
{
j = 0;
while(j < m)
{
printf("[%4d]", B[i][j]);
j++;
}
printf("\n");
i++;
}
j = 0;
printf("\n");
while (j < m)
{
i = 0;
negsum = 0;
while(i<n)
{
if (B[i][j]<0)
{
negsum+=B[i][j];
}
i++;
}
printf("%4d", negsum);
j++;
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment