ROW WISE SUM IN C
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <stdio.h>
int main()
{
int r,c;
printf("enter row size:- ");
scanf("%d",&r);
printf("enter the column size :-");
scanf("%d",&c);
int q[r][c];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
scanf("%d", &q[i][j]);
}
}
for (int i = 0; i < r; i++) {
int row=0;
for (int j = 0; j < c; j++) {
row=row+q[i][j];
}
printf("%d\n",row);
}
}
Comments
Post a Comment