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 many key words availabel in c a) 28 b) 31 c) 32
In a header file whether functions are declared or defined?
How a string is stored in c?
What is the output of the following program #include<stdio.h> main() { int i=0; fork(); printf("%d",i++); fork(); printf("%d",i++); fork(); wait(); }
How can I access memory located at a certain address?
A program to write a number of letters and numbers, such as counting and display
What is meant by int fun const(int a, int b) { .... ... }
What is sizeof int in c?
What is call by reference in functions?
What kind of sorting is this? SORT (k,n) 1.[Loop on I Index] repeat thru step2 for i=1,2,........n-1 2.[For each pass,get small value] min=i; repeat for j=i+1 to N do { if K[j]<k[min] min=j; } temp=K[i];K[i]=K[min];K[min]=temp; 3.[Sorted Values will be returned] A)Bubble Sort B)Quick Sort C)Selection Sort D)Merge Sort
What are register variables? What are the advantage of using register variables?
How to write c functions that modify head pointer of a linked list?