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 a pragma?
What is main () in c language?
What is a stream water?
What is bash c?
why return type of main is not necessary in linux
How do you do dynamic memory allocation in C applications?
Hi can anyone tell what is a start up code?
What are multidimensional arrays?
What is 2 d array in c?
What is a good data structure to use for storing lines of text?
How many types of functions are there in c?
Explain a pre-processor and its advantages.
Why n++ execute faster than n+1 ?
What is file in c preprocessor?
simple program of graphics and their output display