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

Discussion :: Functions - C++

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

     #include 
     #include 
     class GateString 
     {  
        char x[50];   
        char y[50];    
        char z[50];      
        public:     
        GateString()     
        { }  
        GateString(char* xx)   
        {       
            strcpy(x, xx);      
            strcpy(y, xx);    
        } 
         GateString(char *xx, char *yy = " C++", char *zz = " Programming!")  
        {      
           strcpy(z, xx);  
           strcat(z, yy);     
           strcat(z, zz);  
       }   
       void Display(void)   
        {   
        coutint main() 
      {    
         GateString objStr("Learn", " Java");      
         objStr.Display();  
         return 0;  
      }
    
    

  2. A.

    Java Programming!

    B.

    C++ Programming!

    C.

    Learn C++ Programming!

    D.

    Learn Java Programming!

    E.

    Learn Java C++ Programming!

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    No answer description available for this question.


Be The First To Comment