Data Types

  1. What is the range of a signed char variable in C?
    1. 0 to 255
    2. -128 to 127
    3. 0 to 127
    4. -128 to 255
  1. View Hint | View Answer | Workspace | Discuss In Forum | Report

    char is a single byte variable. Signed char would include negative numbers as well

    Correct Option: B

    range of signed char variable is -128 to 127 because it is 1 byte long.
    2 to the power 8 is 256, range included 256 numbers, as it is signed, include negative integers starting from -128 to 127.

    Report