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 / 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


Please Help Members By Posting Answers For Below Questions

What is difference between class and structure?

1115


What does the error message "DGROUP exceeds 64K" mean?

1229


What is the explanation for the dangling pointer in c?

1117


What are structure members?

1094


Explain how do you use a pointer to a function?

1110


How can variables be characterized?

2190


What are dangling pointers in c?

1234


What type is sizeof?

1039


What is register variable in c language?

1029


Explain bitwise shift operators?

1251


What is the sizeof () a pointer?

996


how to create duplicate link list using C???

2560


What are integer variable, floating-point variable and character variable?

1253


What is %s and %d in c?

1047


What is the difference between a function and a method in c?

1085