C Quiz interview questions

134 questions. Tap “Show answer” to check yourself.

Advertisement
  1. The index value for an element in an array is indicated within _____ brackets.

    1. /*
    2. ()
    3. []
    4. {}
    Show answer

    C. []

  2. How many bits are used to store data starting from right extreme?

    1. 15
    2. 16
    3. 32
    4. 64
    Show answer

    A. 15

  3. Static and Register variables are automatically initialized to _____ value when they are declared.

    1. 0
    2. 1
    3. 2
    4. 3
    Show answer

    A. 0

  4. The long int, signed long int has _____ bytes.

    1. 2
    2. 3
    3. 4
    4. 8
    Show answer

    C. 4

  5. What is the range for char data type in C++?

    1. -126 to 127
    2. -127 to 128
    3. 128 to -127
    4. -128 to 127
    Show answer

    D. -128 to 127

  6. What is the prefix character used to represent escape sequence?

    1. - =
    2. +
    3. *
    4. /
    Show answer

    D. /

  7. The _____ symbol is used to declare a pointer variable.

    1. #
    2. /
    3. &
    4. *
    Show answer

    D. *

  8. The operator _____ is called the insertion operator or put to operator.

    1. >
    2. >>
  9. The number of elements in a 2 dimensional array is determined by multiplying the number of _____ with number of _____

    1. row, columns
    2. row, row
    3. columns, columns
    4. rows, columns
    Show answer

    D. rows, columns

  10. _____ creates branches for multiple alternatives section of code, depending on the value of a single variable.

    1. while
    2. for
    3. if
    4. switch
    Show answer

    D. switch

  11. _____ punctuator is used to treat statements as comments.

    1. /
    2. //
    3. +
    4. *
    Show answer

    B. //

  12. The minimum value stored in an integer variable is

    1. 32780
    2. -32767
    3. 32769
    4. -32768
    Show answer

    D. -32768

  13. Advertisement
  14. The pointer data type address of _____ operator is used.

    1. &
    2. #
    3. /
    4. *
    Show answer

    A. &

  15. The unsigned char, and char data types has _____ bits.

    1. 8
    2. 16
    3. 32
    4. 64
    Show answer

    A. 8

  16. The modifier _____ instructs the compiler to store the variable in the CPU register to optimize access.

    1. register
    2. static
    3. extern
    4. auto
    Show answer

    A. register

  17. _____ data type is further divided into float and double.

    1. double
    2. float
    3. char
    4. int
    Show answer

    B. float

  18. In _____ method, the called function arguments formal parameters become alias to the actual parameters in the calling function.

    1. return
    2. call
    3. call by value
    4. call by reference
    Show answer

    D. call by reference

  19. The declaration statement char *cp, is a _____ type pointer.

    1. double
    2. string
    3. character
    4. integer
    Show answer

    C. character

  20. The base data type should be prefixed with the _____ at the time of declaring a variable.

    1. dimension
    2. variable
    3. constant
    4. modifiers
    Show answer

    D. modifiers

  21. In C++ int data type has the range of values

    1. 32767 to 32768
    2. 32768 to 32769
    3. -32768 to 32767
    4. -32768 to 32768
    Show answer

    C. -32768 to 32767

  22. What are the equality operators?

    1. ==
    2. ! =
    3. both a and b
    Show answer

    D. both a and b

  23. Integral is the _____ data type.

    1. float
    2. double
    3. integer
    4. char
    Show answer

    C. integer

  24. When elements are stored column-wise manner it is called as _______ order.

    1. row
    2. column
    3. row-major
    4. column-major
    Show answer

    D. column-major

  25. When the modifier unsigned is used the integer data type will store only _____ values, the sign bit is also used to store data.

    1. one
    2. two
    3. positive
    4. negative
    Show answer

    C. positive

  26. Advertisement
  27. _____ bit is also called as the most significant bit or sign bit.

    1. 15th
    2. 16th
    3. 17th
    4. 18th
    Show answer

    B. 16th

  28. The default return data type of a function, if no data type is explicitly mentioned is

    1. double
    2. float
    3. char
    4. int
    Show answer

    D. int

  29. The maximum value stored in an integer variable is

    1. 32768
    2. -32768
    3. 32767
    4. 32780
    Show answer

    C. 32767

  30. The range to store integer data goes upto

    1. 213
    2. 214
    3. 215
    4. 216
    Show answer

    D. 216

  31. _____ data type that can hold both character data and the integer data.

    1. double
    2. float
    3. char
    4. int
    Show answer

    C. char

  32. _____ data type enables to invent his own data type and define values.

    1. Integral
    2. Floating
    3. Derived
    4. User defined
    Show answer

    D. User defined

Advertisement