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 |
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
What is the output of the program given below #include<stdio.h> main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
21 Answers ADITI, Student, TCS,
What is the mean of this statement:: if(int i=0 * i=9)
How many bytes is a struct in c?
How many types of operators are there in c?
main() { printf("hello%d",print("QUARK test?")); }
I came across some code that puts a (void) cast before each call to printf. Why?
How can a program be made to print the name of a source file where an error occurs?
#include<stdio.h> void main() { int =1; printf("%d%d%d",a++,++a,++a); }
Why can't I perform arithmetic on a void* pointer?
write a program for size of a data type without using sizeof() operator?
22 Answers HCL, IBM,
character array A[12] can hold