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 |
The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?
write a C and C++ programme to implement the A,bubble sort B,quick sort C,insertion sort D,sequential search E,binary search
What are the application of c?
Give me the code of in-order recursive and non-recursive.
What is ambagious result in C? explain with an example.
Why do we use & in c?
How are Structure passing and returning implemented by the complier?
Why does everyone say not to use scanf? What should I use instead?
Why header file is used in c?
How can I use a preprocessorif expression to ?
#include<stdio.h> #include<conio.h> # define swap(a,b) temp=a; a=b; b=temp; void main( ) { int i, j, temp; i=5; j=10; temp=0; if( i > j) swap( i, j ); printf( "%d %d %d", i, j, temp); }
Find greatest number out of 10 number without using loop.