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 |
How are variables declared in c?
Explain the advantages and disadvantages of macros.
Write a c program to find, no of occurance of a given word in a file. The word is case sensitive.
Write a program to enter the name and age. If age>28 then find salary categories. if age<28 then find that you are gaduate or not.
why division operator not work in case of float constant?
what is data structure?
How many bytes are occupied by near, far and huge pointers (dos)?
Is c an object oriented programming language?
Explain two-dimensional array.
Why is struct padding needed?
Example of friendly function in c++
1)which of following operator can't be overloaded. a)== b)++ c)?! d)<=