Home / C++ Programming / References :: Discussion

Discussion :: References

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

     #include
      struct Gate 
      {   
          short n; 
      }; 
      int main() 
      {  
          Gate b;     
          Gate& rb = b;   
          b.n = 5;   
          cout " " " ";     
          rb.n = 8;  
          cout " " return 0;  
     }
    
    

  2. A.

    It will result in a compile time error.

    B.

    The program will print the output 5 5 5 8.

    C.

    The program will print the output 5 5 8 8.

    D.

    The program will print the output 5 5 5 5.

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    No answer description available for this question.


Be The First To Comment