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 does main () mean in c?
What are different types of pointers?
How many types of linked lists what are they? How many types of data structures?
18 Answers BSNL, Pivotal Software,
How can I write functions that take a variable number of arguments?
Write a function that will take in a phone number and output all possible alphabetical combinations
write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.
write a program for 4 4 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 4 4
write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]
how to find the size of the data type like int,float without using the sizeof operator?
How do you define a function?
Why do we use int main?
What is the purpose of void pointer?