Integer Types

1

What will be output of this function?

1.
    int main()
2.    
    {
3.    
        register int i = 1;
4.        
        int *ptr = &i;
5.        
        cout << *ptr;
6.        
	return 0;
7.	
    }

A. 0
B. 1
C. Compiler error may be possible
D. Runtime error may be possible

2

What will be output of this program?

   
1.
    #include 
2.    
    using namespace std;
3.    
    int main()
4.    
    {
5.    
        int i = 3;
6.        
        int l = i / -2;
7.        
        int k = i % -2;
8.        
        cout << l << k;
9.
        return 0;
10.        
    }
A. compile time error
B. -1 1
C. 1 -1
D. implementation defined

3

What will be the output of this program?

1.
    #include 
2.    
    using namespace std;
3.    
    int main()
4.    
    {
5.    
        int a = 8;
6.        
        cout << "ANDing integer 'a' with 'true' :"" << a && true;
7.        
        return 0;
8.        
    }
A. integer 'a' with 'true' :8
B. ANDing integer 'a' with 'true' :0
C. ANDing integer 'a' with 'true' :1
D. None of the mentioned

4

0946, 786427373824, 'x' and 0X2f are _____, _____, ____ and _____ literals respectively

A. decimal, character,octal, hexadecimal
B. octal, hexadecimal, character, decimal
C. hexadecimal, octal, decimal, character
D. octal, decimal, character, hexadecimal

5

Which of these expressions will isolate the rightmost set bit?

A. x = x & (~x)
B. x = x ^ (~x)
C. x = x & (-x)
D. x = x ^ (-x)