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 structure to find average of given number



write a program structure to find average of given number..

Answer / manjunath

#include<stdio.h>
#include<math.h>
void main()
{
int num,a[100],sum=0;
float average;
printf("enter the number of elements");
scanf("%d",&num);
printf("enter the elements");
for(i=0;i<num;i++)
{
scanf("%d",&a[i]);
}
printf("the elements are");
for(i=0;i<num;i++)
{
printf("%d",a[i]);
}
for(i=0;i<num;i++)
{
sum=sum+a[i];
}
average=sum/num;
printf("%f",average);
}

Is This Answer Correct ?    13 Yes 9 No

Post New Answer

More C Interview Questions

What is difference between far and near pointers?

0 Answers  


1,1,5,17,61,217,?,?.

3 Answers   Apple,


i=10,j=20 j=i,j?(i,j)?i:j:j print i,j

1 Answers   CSC,


How reliable are floating-point comparisons?

0 Answers  


Give a method to count the number of ones in a 32 bit number?

4 Answers  


which operator is known as dummy operator in c?

2 Answers   Wipro,


What is output of the following program ? main() { i = 1; printf("%d %d %d\n",i,i++,i++); }

9 Answers   CTS, Wipro,


Explain the difference between exit() and _exit() function?

0 Answers  


What are the advantages and disadvantages of pointers?

0 Answers  


difference between function & structure

9 Answers   Verizon,


How to find the given no is odd or even without checking of any condition and loops. (Hint: Using array)

4 Answers  


Who is the founder of c language?

0 Answers  


Categories