Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

what is the diffrenet bettwen HTTP and internet protocol

1785


What is NULL pointer?

1036


How will you write a code for accessing the length of an array without assigning it to another variable?

999


what are the facialities provided by you after the selection of the student.

2175


What is calloc() function?

1047


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2365


What is the hardest programming language?

1095


What is the significance of scope resolution operator?

1346


What are formal parameters?

1067


What is substring in c?

1131


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

1446


What are the advantages of using macro in c language?

1066


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

1029


There seem to be a few missing operators ..

1003


What is local and global variable in c?

1127