Questions with Answers on Character Representation


  1. How many bits are used for an ASCII character representation?
  2. What are both the binary and hexadecimal representations for the characters:
    A. R
    01010010, 0x52
    B. :
    00111010, 0x3a
    C. 8
    00111000, 0x38
    D. the NULL character used in C
    00000000, 0x00
  3. What ASCII character is represented by
    A. 0x44 D
    B. 0x7b {
    C. 0x26 &
  4. A computer is executing a C program that does
    
        char X;
        X = '(' + '1';
        printf("%c", X);
    
    
    What character is printed out? Y

    Explanation: The character ( is 40 (decimal). The character 1 is 49 (decimal). They sum to 89, which is the ASCII character Y.

Copyright © Karen Miller, 2007