write a program to find the sum of the array elements in c
language?
Answer Posted / madhura musale
#include<stdio.h>
#include<conio.h>
void main()
{
int i,a[10],sum;
clrscr();
printf("\n Enter the elements in an array :");
for(i=0;i<10;i++)
scanf("%d",&a[i]);
printf("\n The sum of elements of an array are :");
for((i=0;i<10;i++)
sum=sum+a[i];
printf("\t %d",sum);
getch();
}
Is This Answer Correct ? | 25 Yes | 26 No |
Post New Answer View All Answers
Explain what is the benefit of using enum to declare a constant?
Why do we need a structure?
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...
Which is more efficient, a switch statement or an if else chain?
Do you know the purpose of 'register' keyword?
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
What is the difference between near, far and huge pointers?
What is a c token and types of c tokens?
What are the valid places to have keyword “break”?
5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.
How many types of operator or there in c?
What is variable and explain rules to declare variable in c?
What is dangling pointer in c?
What does nil mean in c?