Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the difference between ++a and a++?

1215


the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset

1109


7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

2761


What is the use of sizeof () in c?

1059


What are the keywords in c?

1128


Explain what is output redirection?

1199


How can you find the day of the week given the date?

1204


What is the symbol indicated the c-preprocessor?

1254


Define Array of pointers.

1112


Explain the properties of union.

1087


What is the general form of function in c?

1022


how do you execute a c program in unix.

1116


Explain what is the use of a semicolon (;) at the end of every program statement?

1232


Give basis knowledge of web designing ...

2021


What is a global variable in c?

1014