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
How do you determine a file’s attributes?
What are extern variables in c?
Explain that why C is procedural?
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
is it possible to create your own header files?
What is a null string in c?
Once I have used freopen, how can I get the original stdout (or stdin) back?
How can I delete a file?
What is the advantage of a random access file?
Explain the use of function toupper() with and example code?
What is preprocessor with example?
Differentiate between a for loop and a while loop? What are it uses?
What is structure padding in c?
how we can make 3d venturing graphics on outer interface
2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier. Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed. When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed. Sequence of take-off is the sequence of addition to the waitlist