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 are two dimensional arrays alternatively called as?

1187


Is it possible to use curly brackets ({}) to enclose single line code in c program?

1321


Explain how can I right-justify a string?

1046


What is c standard library?

1207


What are the rules for identifiers in c?

1070


Is fortran still used today?

1095


What will be your course of action for a push operation?

1112


What do you mean by c what are the main characteristics of c language?

1033


What is variable and explain rules to declare variable in c?

1091


Tell us bitwise shift operators?

1094


Do pointers need to be initialized?

1084


Why can’t constant values be used to define an array’s initial size?

1380


Why malloc is faster than calloc?

1066


Why doesnt the call scanf work?

1195


How is a macro different from a function?

1186