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

#include<stdio.h>
void main()
{
int a[i],sum=0;
printf("enter n value");
scanf("%d",&n);
for(i=0;i<n,i++)
{
scanf("%d",&a[i])
}
for(i=0;i<n;i++)
{
sum=sum+a[i];
}
printf("sum=%d");
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where is c used?

1092


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

2825


How would you use the functions fseek(), freed(), fwrite() and ftell()?

1161


Is this program statement valid? INT = 10.50;

1141


What is function pointer c?

1106


What are the different types of data structures in c?

1162


What is call by reference in functions?

1439


How does placing some code lines between the comment symbol help in debugging the code?

986


How do you sort filenames in a directory?

1166


how to create duplicate link list using C???

2556


What is volatile keyword in c?

1034


Without Computer networks, Computers will be half the use. Comment.

2296


Do you know the difference between malloc() and calloc() function?

1055


I have a varargs function which accepts a float parameter?

1038


Why dont c comments nest?

1045