Character Types

1

What constant defined in <climits> header returns the number of bits in a char?

A. CHAR_SIZE
B. SIZE_CHAR
C. BIT_CHAR
D. CHAR_BIT

2

Suppose in a hypothetical machine, the size of char is 32 bits. What would sizeof(char) return?

A. 4
B. 1
C. Implementation dependent
D. Machine dependent

3

Is the size of character literals different in C and C++?

A. Implementation defined
B. Can't say
C. Yes, they are different
D. No, they are not different

4

In C++, what is the sign of character data type by default?

A. Signed
B. Unsigned
C. Implementation dependent
D. None of these

5

What is the output of this program?

1.
    #include 
2.    
    int main()
3.    
    {
4.    
        char a = '\012';
5.        
 
6.
        printf("%d", a);

7.
        return 0;
8.        
    }

A. Compiler error
B. 12
C. 10
D. Empty