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

Explain the advantages of using macro in c language?

967


#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??

1924


What is the size of structure in c?

1115


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

3213


What are the scope of static variables?

1136


What is 1d array in c?

1048


What is a stream water?

1146


i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....

1933


what do you mean by enumeration constant?

971


Can the “if” function be used in comparing strings?

998


What does c value mean?

1129


write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);

2312


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

2287


What is the use of typedef in structure in c?

933


What is #line?

1016