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 |
Define function ?Explain about arguments?
2 Answers Geometric Software, Infosys,
what is the output of the following program? #include<stdio.h> void main() { int x=4,y=3,z; z=x-- -y; printf("\n%d %d %d",x,y,z); }
where are auto variables stored? What are the characteristics of an auto variable?
while initialization of array why we use a[][2] why not a[2][]...?
Write a program to print distinct words in an input along with their count in input in decreasing order of their count
regarding the scope of the varibles;identify the incorrect statement: a.automatic variables are automatically initialised to 0 b.static variables are are automatically initialised to 0 c.the address of a register variable is not accessiable d.static variables cannot be initialised with any expression
Tell me can the size of an array be declared at runtime?
plz answer..... a program that reads non-negative integer and computes and prints its factorial
Write a program of advanced Fibonacci series.
Write a program to use switch statement.
0 Answers Agilent, Integreon, ZS Associates,
How to implement variable argument functions ?
Reverse the bit order in a single macro. eg. i/p = 10010101 --> o/p = 10101001