Sizes

1

What would be the output of the following program (in 32-bit systems)?

1.
    #include 
2.    
    using namespace std;
3.    
    int main()
4.    
    {
5.    
        cout << sizeof(char);
6.        
        cout << sizeof(int);
7.        
        cout << sizeof(float);
8.        
        return 0;
9.        
    }
A. 1 4 4
B. 1 4 8
C. 1 8 8
D. none of the mentioned

2

What is the output of the following program?

 
1.
    #include 
2.    
    using namespace std;
3.    
    int main()
4.    
    {
5.    
        int a = 5;
6.        
        float b;
7.       
        cout << sizeof(++a + b);
8.
        cout << a;
9.        
        return 0;
10.        
    }
A. 2 6
B. 4 6
C. 2 5
D. 4 5

3

What is the output of the following program?

 
1.
    #include 
2.    
    using namespace std;
3.    
    int main()
4.    
    {
5.    
        int num1 = 10;
6.        
        float num2 = 20;
7.        
        cout << sizeof(num1 + num2);
8.        
        return 0;
9.        
    }
A. 2
B. 4
C. 8
D. garbage

4

What is the output of the following program?

1.
    #include 
2.    
    using namespace std;
3.    
    int main ( )
4.    
    {
5.    
        static double i;
6.        
        i = 20;
7.        
        cout << sizeof(i);
8.        
        return 0;
9.        
    }

A. 4
B. 2
C. 8
D. garbage

5

What is the output of the following program?

 
1.
    #include 
2.    
    using namespace std;
3.    
    int main()
4.    
    {
5.    
        int num = 0x20 + 020 + 20;
6.        
        cout << sizeof(num)<<'\n';
7.        
        return 0;
8.        
    }
A. 2
B. 4
C. Depends on compiler.
D. garbage