write a program structure to find average of given number
Answer Posted / 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 View All Answers
What are the application of c?
How can you check to see whether a symbol is defined?
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.
When should I declare a function?
What is the ANSI C Standard?
What does do in c?
shorting algorithmS
why wipro wase
Explain continue keyword in c
Why c language is called c?
What is a keyword?
What is switch in c?
What is pre-emptive data structure and explain it with example?
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above