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
what is the diffrenet bettwen HTTP and internet protocol
What is NULL pointer?
How will you write a code for accessing the length of an array without assigning it to another variable?
what are the facialities provided by you after the selection of the student.
What is calloc() function?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What is the hardest programming language?
What is the significance of scope resolution operator?
What are formal parameters?
What is substring in c?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What are the advantages of using macro in c language?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
There seem to be a few missing operators ..
What is local and global variable in c?