c-programming-mcqs - Set (4)

Correct Answer: Orange && Worng Answer: Red

1. A C variable cannot start with

  • (A). An alphabet
  • (B). A number
  • (C). A special symbol other than underscore
  • (D). Both (b) and (c)
  • View Answer

    Explanation: Not Avilable

    2. Select the odd one out with respect to type ?

  • (A). Char
  • (B). Int
  • (C). Long
  • (D). Float
  • View Answer

    Explanation: Not Avilable

    3. Which type of variable can have same name in different function

  • (A). Global variable
  • (B). Static variable
  • (C). Function argument
  • (D). Both (b) and (c)
  • View Answer

    Explanation: Not Avilable

    4. For 16-bit compiler allowable range for integer constants is ______ ?

  • (A). -3.4e38 to 3.4e38
  • (B). -32767 to 32768
  • (C). -32768 to 32767
  • (D). -32668 to 32667
  • View Answer

    Explanation: Not Avilable

    5. Which of the following is false in ‘C’.

  • (A). Capital letters can be used in variable names.
  • (B). Variable names can contain a digit.
  • (C). Variable names do not contain a blank space.
  • (D). Keywords can be used as variable names.
  • View Answer

    Explanation: Keywords never be used in Variable declaration.

    6. An “int” datatype requires :

  • (A). 2 bytes
  • (B). 3 bytes
  • (C). 1 bytes
  • (D). 8 bytes
  • View Answer

    Explanation: Not Avilable

    7. Which of the following spwcial symbol allowed in a variable name ?

  • (A). *(Asterisk)
  • (B). |(Pipeline)
  • (C). -(Hyphen)
  • (D). _(Underscore)
  • View Answer

    Explanation: Not Avilable

    8. The structure combines variables of ______ data type.

  • (A). Similar
  • (B). Variable
  • (C). Dissimilar
  • (D). None of these
  • View Answer

    Explanation: The structure combines variables of dissimilar user-defined data types.

    9. What is the value range of data type unsigned short int

  • (A). -128 to 127
  • (B). 0 to 255
  • (C). 0 to 65535
  • (D). 0 to 128
  • View Answer

    Explanation: Not Avilable

    10. How many of bytes in memory required for single character in computer ?

  • (A). 8 bytes
  • (B). 2 bytes
  • (C). 4 bytes
  • (D). 1 bytes
  • View Answer

    Explanation: Not Avilable

    11. Which of the following cannot be checeked in a swith case statement ?

  • (A). Float
  • (B). Interger
  • (C). Character
  • (D). None of the above
  • View Answer

    Explanation: A switch-case statement must be an integer, char, short, long. Float and double are not allowed.

    12. If ‘a’ is an interger variable, then a=5/2; will return a value

  • (A). 2.5
  • (B). 3
  • (C). 2
  • (D). 0
  • View Answer

    Explanation: Because integer store only whole number it doesn’t contain deecimal number.

    13. Which of the following is the correct way of declaring float pointer.

  • (A). float ptr
  • (B). float *ptr
  • (C). *float ptr
  • (D). None of above
  • View Answer

    Explanation: Pointer declaration: datatype *var-name;

    14. Address stored in pointer variable is of type

  • (A). Integer
  • (B). Float
  • (C). Char
  • (D). Array
  • View Answer

    Explanation: Not Avilable

    15. Which of the following can a format string of printf() function contain :

  • (A). Character, format specifications and escape sequences
  • (B). Character, interger and floats
  • (C). Strings, integers and escape sequences
  • (D). Inverted commas, precentage sign and backslash character
  • View Answer

    Explanation: Not Avilable