Home / C++ Programming / Functions - C++ :: Discussion

Discussion :: Functions - C++

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

      #include
      class Freshergate
      {   
        public:    
       void Gate(int x = 15)   
       {        
            x = x/2;        
            if(x > 0)        
                Gate();       
             else        
                cout2;   
       }  
     }; 
     int main() 
     {   
        FreshergateobjIB;   
        objIB.Gate;    
        return 0;  
    }
    

  2. A.

    The program will display 1.

    B.

    The program will display 2.

    C.

    The program will display 15.

    D.

    The program will go into an infinite loop.

    E.

    The program will report error on compilation.

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    No answer description available for this question.


Be The First To Comment