write a program to print sum of each row of a 2D array.
Answer Posted / vignesh1988i
first ordinary logic.
LOGIC 1
#include<stdio.h>
#include<conio.h>
void main()
{
int a[50][50],k,row,column;
printf("enter the number of rows and columns of 2D array :");
scanf("%d%d",&row,&column);
for(int i=0;i<row;i++)
{
for(int q=0;q<column;q++)
{
scanf("%d",&a[i][q]);
}
}
for(i=0;i<row;i++)
{
k=0;
for(q=0;q<column;q++)
{
k=k+a[i][q];
}
printf("%d\n",k);
}
getch();
}
| Is This Answer Correct ? | 20 Yes | 32 No |
Post New Answer View All Answers
What is c programing language?
What is c value paradox explain?
What does it mean when the linker says that _end is undefined?
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
Which type of language is c?
how could explain about job profile
while initialization of array why we use a[][2] why not a[2][]...?
What are structures and unions? State differencves between them.
Can we access array using pointer in c language?
What is difference between union and structure in c?
What is the purpose of the statement: strcat (S2, S1)?
Which control loop is recommended if you have to execute set of statements for fixed number of times?
Define recursion in c.
What is a program flowchart and explain how does it help in writing a program?
What is difference between && and & in c?