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 a pragma?

1178


What is main () in c language?

1187


What is a stream water?

1281


What is bash c?

1063


why return type of main is not necessary in linux

2151


How do you do dynamic memory allocation in C applications?

1137


Hi can anyone tell what is a start up code?

2135


What are multidimensional arrays?

1170


What is 2 d array in c?

1087


What is a good data structure to use for storing lines of text?

1139


How many types of functions are there in c?

1226


Explain a pre-processor and its advantages.

1190


Why n++ execute faster than n+1 ?

3146


What is file in c preprocessor?

1194


simple program of graphics and their output display

2048