Tuesday, 22 March 2016

MCQ - CPU


1) Who is father of C Language?




D.  E. F. Codde

2) C Language developed at _________?




D. Cambridge University in 1972

3) Output of follwing code 
  #include <stdio.h>
  void main() 
  {
             int x = 5;  
             if (x < 1); 
                 printf("Hello");
}

4) Output of following code

#include <stdio.h>
        void main()
        {
            double ch;
            printf("enter a value btw 1 to 2:");
            scanf("%lf", &ch);
            switch (ch)
            {
            case 1:
                printf("1");
                break;
            case 2:
                printf("2");
                break;
            }
        }


5) Output of following code

    #include <stdio.h>
    void main()
   {
            int ch;
            printf("enter a value btw 1 to 2:");
            scanf("%d", &ch);
            switch (ch, ch + 1)
            {
            case 1:
               printf("1\n");
                break;
            case 2:
                printf("2");
                break;
            }
        }


6) Which of the following operator takes only integer operands?
A. +
B. *
C. /
D. %
E. None of these


7)  Output:
void main()
{
    int i=0, j=1, k=2,m;
    m = i++|| j++ || k++;
    printf("%d %d %d %d",m,i,j,k);


8) Output:
void main()
{
      int i=10;
      i = !i>14;
      printf("i=%d", i);
}
 
9) Output:
void main()
{
      int a, b, c, d;
      a = 3;
      b = 5;
      c = a, b;
      d = (a, b);
      printf("c=%d d=%d", c, d);
}
10) Output:
void main()
{
    int z, x=5, y= -10, a=4, b=2;
    z = x++ - --y*b/a;
    printf("%d",z);
}
 



No comments:

Post a Comment