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 |
What is difference between far and near pointers?
1,1,5,17,61,217,?,?.
i=10,j=20 j=i,j?(i,j)?i:j:j print i,j
How reliable are floating-point comparisons?
Give a method to count the number of ones in a 32 bit number?
which operator is known as dummy operator in c?
What is output of the following program ? main() { i = 1; printf("%d %d %d\n",i,i++,i++); }
Explain the difference between exit() and _exit() function?
What are the advantages and disadvantages of pointers?
difference between function & structure
How to find the given no is odd or even without checking of any condition and loops. (Hint: Using array)
Who is the founder of c language?