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 which calculate sum of several number and input it into an array. Then, the sum of all the number in the array is calculated.

Answer Posted / devi

#include<stdio.h>
#include<conio.h>
void main()
{
int a[200],i,n;
float sum=0,avg;
clrscr();
printf("Enter the n values");
scanf("%d",&n);
for(i=0;i<n;i++)
{
sum=sum+a[i];
}
avg=sum/n;
printf("Sum of %d array values is:%f",n,avg);
getch();
}

Is This Answer Correct ?    7 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between constant pointer and constant variable?

1203


What is a structural principle?

1145


Describe the order of precedence with regards to operators in C.

1036


What is a structure member in c?

991


What does a pointer variable always consist of?

1085


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

2853


How can I make it pause before closing the program output window?

1029


What is #define used for in c?

1050


Is it possible to have a function as a parameter in another function?

1060


‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

2320


What does s c mean in text?

1087


What is null pointer constant?

1131


What are structure members?

1070


What is enumerated data type in c?

1069


What is far pointer in c?

1297