C Language quiz questions

C Language interview questions

  • 1.

    Which of the following identifiers is a legal identifier?

    1. abc#*

    2. #+abc

    3. abc

    Answer
  • 2.

    Which of the following identifiers is a legal identifier:

    1. my mark

    2. my_mark

    3. my-mark

    Answer
  • 3.

    Which of the following identifiers is a legal identifier :

    1. 1abc

    2. abc 1

    3. abc1

    Answer
  • 4.

    What is the output of the following piece of code?

    int  x = 3, y = 5, z ;
    z = x++ + ++y;
    printf(“%d”,z);

     

    1. 8

    2. 9

    3. 10

    Answer
  • 5.

    What is the output of the following piece of code?

    int  x = 3, y = 5, z;
    z = x + ++y;
    printf(“%d”,z);

     

    1. 8

    2. 9

    3. 10

    Answer
  • 6.

    What is the output of the following piece of code:

    int  x = 3, y = 5, z;
    z = ++x + ++y;
    printf(“%d”,z);

     

    1. 8

    2. 9

    3. 10

    Answer
  • 7.

    To print character a:

    1. putch("a");

    2. putch(‘a’);

    3. Both correct

    Answer
  • 8.

    To write the ASCII code of char ch=’x’;

    1. printf("%d",ch);

    2. putch(ch);

    3. printf("%d", ascii(ch));

    Answer
  • 9.

    What is the output of the following piece of code:

    switch(2) {
    case 1: printf(“One”);	break;
    case 2: printf(“Two”);	break;
    case 3: printf(“Three”);	break;
    }

     

    1. One

    2. Two

    3. TwoThree

    Answer
  • 10.

    What is the output of the following piece of code:

    switch(2) {
    case 1: printf(“One”);	break;
    case 2: printf(“Two”);	
    case 3: printf(“Three”);	break;
    }

     

    1. One

    2. Two

    3. TwoThree

    Answer
  • 11.

    If LSB of a binary number is "0" then it is:

    1. Positive number

    2. Even number

    3. Odd number

    Answer
  • 12.

    The highest digit in any number system equals:

    1. Zero

    2. Base - 1

    3. Base + 1

    Answer
  • 13.

    what is the result of the condition ( x ;; y ) given the declaration :

    int x = 1 , y = 2 ;

     

    1. true

    2. false

    3. unknown

    Answer
  • 14.

    the ; operator in the Boolean condition if( (x>5) ; ( y < 9 ) ) …

    1. bit-wise AND operator

    2. address operator

    3. logical AND operator

    Answer
  • 15.

    what is the storage size of the integer data type (char)?

    1. 1 byte

    2. 2 byte

    3. 4 byte

    Answer
  • 16.

    what is the storage size of the float data type (float)?

    1. 1 byte

    2. 2 byte

    3. 4 byte

    Answer
  • 17.

    The operator = in the Boolean condition if( age = 3 )

    1. assignment operator

    2. check for equality condition operator

    3. both correct

    Answer
  • 18.

    To find the max value between x,y :

    1. if ( x > y ) max = x;

      else max = y;

    2. max = y;

      if ( x > y ) max = x;

    3. both correct

    Answer
  • 19.

    To compute the square of the value in variable a:

    1. b = a^2;

    2. z = a * a;

    3. both correct

    Answer
  • 20.

    what is the output of the following piece of code:

    int  c = 19 %  4;

     

    1. 1

    2. 2

    3. 3

    Answer

© 2017 QuizBucket.org