write a program to print sum of each row of a 2D array.
Answer Posted / khurshid alam
#include<stdio.h>
int main()
{
int a[3][3]={{2,5},{7,8},{1,1}};
int b[3][3]={{5,6},{9,3},{1,1}},i,j,*m,*n,s=0;
n=&a[j][i];
m=&b[j][i];
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
s+=a[i][j]+b[i][j];
}
}
printf("Sum :%d",s);
return 0;
}
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
Which node is more powerful and can handle local information processing or graphics processing?
What is const and volatile in c?
how to build a exercise findig min number of e heap with list imlemented?
What are the different file extensions involved when programming in C?
Explain the difference between #include "..." And #include <...> In c?
what is the role you expect in software industry?
FILE PROGRAMMING
What is oops c?
How can I get the current date or time of day in a c program?
what are enumerations in C
How is null defined in c?
Is int a keyword in c?
write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.
What is s or c?
What is sorting in c plus plus?