write a program to find the sum of the array elements in c
language?
Answer Posted / aisha
#include<Stdio.h>
void main()
{
int sum=0,a[10],i,n;
printf("enter value of n");
scanf("%d",&n);
printf("enter array elements");
for(i=o;i<=n;;i++)
scanf("%d",&a[i]);
for(i=0;i<=n;i++)
{
sum= sum+a[i];
}
printf("sum of all array elements = %d",sum);
}
| Is This Answer Correct ? | 11 Yes | 5 No |
Post New Answer View All Answers
What is difference between class and structure?
What does the error message "DGROUP exceeds 64K" mean?
What is the explanation for the dangling pointer in c?
What are structure members?
Explain how do you use a pointer to a function?
How can variables be characterized?
What are dangling pointers in c?
What type is sizeof?
What is register variable in c language?
Explain bitwise shift operators?
What is the sizeof () a pointer?
how to create duplicate link list using C???
What are integer variable, floating-point variable and character variable?
What is %s and %d in c?
What is the difference between a function and a method in c?