write a program to find the sum of the array elements in c
language?
Answer Posted / m.sushma
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],sum=0,n,i;
printf("Enter range");
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
printf("The sum of all the elements in the given array
is\n");
for(i=0;i<n;i++)
sum=sum+a[i];
printf("%d",sum);
getch();
}
| Is This Answer Correct ? | 19 Yes | 15 No |
Post New Answer View All Answers
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
What is bss in c?
All technical questions
Can the curly brackets { } be used to enclose a single line of code?
What are disadvantages of C language.
Why malloc is faster than calloc?
What are the keywords in c?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
Explain how can I open a file so that other programs can update it at the same time?
What are c header files?
Explain what are the __date__ and __time__ preprocessor commands?
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .
What are the applications of c language?
How many identifiers are there in c?
What is static and auto variables in c?