C LANGUAGE QUIZ
1 .
What is the correct output from the following code?
#include <stdio.h>

int main(int argc, char** argv)
{
   int x = 3;
   printf("%d", x++  +  ++x);
   return 1;
}​

Correct Answer : Option (D)

undefined
  Show Answer
2 .
What is the output of the following code?
void main()
{
int i=0;
while(i++<10)
{
if(i<5 && i<9)
continue;
printf("\n%d\t",i);
}
}​

Correct Answer : Option (B)

5 6 7 8 9 10
  Show Answer
3 .
What is the size of float in a 32-bit compiler?

Correct Answer : Option (C)

4
  Show Answer
4 .
What will be the size of the following structure?
#include <stdio.h>
    struct temp
    {
        int a[10];
        char p;
    };​

Correct Answer : Option (D)

44
  Show Answer
5 .
What is the output of this C code?
#include <stdio.h>
    union
    {
        int x;
        char y;
    }p;
    int main()
    {
        p.y = 60;
        printf("%d\n", sizeof(p));
    }​

Correct Answer : Option (A)

sizeof(char)
  Show Answer
6 .
log(x) function defined in math.h header file is

Correct Answer : Option (A)

Natural base logarithm
  Show Answer
7 .
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int a = 4, n, i, result = 0;
        scanf("%d", n);
        for (i = 0;i < n; i++)
        result += a;
    }​

Correct Answer : Option (C)

Multiplication of a and n
  Show Answer
8 .
What type of inputs are accepted by mathematical functions?

Correct Answer : Option (D)

double 
  Show Answer
9 .
In linux, apart from including math header file, the program is successfully executed by which of the following ?

Correct Answer : Option (B)

cc -lm filename.c
  Show Answer
10 .
Which of the following is not a valid mathematical function?

Correct Answer : Option (C)

fmod(x); 
  Show Answer