Home / C++ Programming / References :: Programs

C++ Programming :: References

  1. Which of the following statement is correct about the program given below?

      #include
      int main() 
      {   
          int x = 80;   
          int y& = x;     
          x++;     
          cout " " return 0;
      }
    

  2. A.

    The program will print the output 80 80.

    B.

    The program will print the output 81 80.

    C.

    The program will print the output 81 81.

    D.

    It will result in a compile time error.

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Which of the following statement is correct about the program given below?

     #include 
      int main() 
      {  
            int x = 80;   
            int &y = x; 
            x++;  
            cout    
            return 0;
      }
    
    

  4. A.

    The program will print the output 80 80.

    B.

    The program will print the output 81 80.

    C.

    The program will print the output 81 81.

    D.

    It will result in a compile time error.

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. Which of the following statement is correct about the program given below?

     #include 
     int main() 
     {   
          int x = 10;  
          int &y = x;    
          x++;   
          cout" "
          return 0; 
     } 
    
    

  6. A.

    The program will print the output 11 12.

    B.

    The program will print the output 12 11.

    C.

    The program will print the output 12 13.

    D.

    It will result in a compile time error.

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. Which of the following statement is correct about the program given below?

     #include
      int main()
      {   
          int x = 10;   
          int &y = x;    
          x = 25;    
          y = 50;
          cout" "
          return 0; 
     }
    

     

  8. A.

    The program will print the output 25 49.

    B.

    It will result in a compile time error.

    C.

    The program will print the output 50 50.

    D.

    The program will print the output 49 49.

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. Which of the following statement is correct about the program given below?

    #include 
     enum bix 
     {   
        a=1, b, c 
     }; 
     int main() 
     {    
          int x = c;    
          int &y = x;    
          int &z = x;     
          y = b; 
          cout
          return 0;
      }
    

  10. A.

    It will result in a compile time error.

    B.

    The program will print the output 1.

    C.

    The program will print the output 2.

    D.

    The program will print the output 3.

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. Which of the following statement is correct about the program given below?

    #include 
     int main() 
     {    
         int x = 10, y = 20;  
         int *ptr = &x;    
         int &ref = y;      
        
         *ptr++;    
          ref++;        
    
        cout" " return 0; 
     }
    

  12. A.

    The program will print the output 10 20.

    B.

    The program will print the output 10 21.

    C.

    The program will print the output 11 20.

    D.

    The program will print the output 11 21.

    E.

    It will result in a compile time error.

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. Which of the following statement is correct about the program given below?

      #include
      int main() 
      {  
           int x = 0;  
           int &y = x; y = 5;   
           while(x 5)    
           {         
               cout" ";        
               x++;    
           }
           coutreturn 0; 
      }
    

  14. A.

    The program will print the output 5 6 7 8 9 10.

    B.

    The program will print the output 5 6 7 8 9 10 7.

    C.

    The program will print the output 5 7.

    D.

    It will result in a compile time error.

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. Which of the following statement is correct about the program given below?

    #include 
     int main() 
     {    
         int m = 2, n = 6;  
         int &x = m;     
         int &y = n;    
         m = x++;      
         x = m++;  
         n = y++;  
         y = n++;  
         cout" " return 0; 
     }
    

  16. A.

    The program will print output 2 6.

    B.

    The program will print output 3 7.

    C.

    The program will print output 4 8.

    D.

    The program will print output 5 9.

    E.

    The program will print output 6 10.

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. Which of the following statement is correct about the program given below?

    #include 
     int main() 
     {   
        int m = 2, n = 6;   
        int &x = m++;    
        int &y = n++;    
        m = x++;    
        x = m++;    
        n = y++;     
        y = n++; 
        cout" " return 0;  
    }
    

  18. A.

    The program will print output 3 7.

    B.

    The program will print output 4 8.

    C.

    The program will print output 5 9.

    D.

    The program will print output 6 10.

    E.

    It will result in a compile time error.

    View Answer

    Workspace

    Discuss Discuss in Forum


  19. What will be the output of the following program?

      #include
      class GateTest
      {    
          public:   
          GateTest(int &x, int &y) 
          {        
                x++;    
                y++;    
      }  
    };
     int main()
     {     
          int a = 10, b = 20; 
          GateTest objBT(a, b);    
          cout" "
          return 0; 
      }
    
    

  20. A.

    10 20

    B.

    11 21

    C.

    Garbage Garbage

    D.

    It will result in a compile time error.

    View Answer

    Workspace

    Discuss Discuss in Forum