Home / C# Programming / Structures :: Discussion

Discussion :: Structures

  1. Which of the following will be the correct output for the program given below?

     namespace FreshergateConsoleApplication
     {   
         struct Sample  
         {        
            public int i;   
         }    
          class MyProgram     
         {     
            static void Main(string[] args)           
            {      
                 Sample x = new Sample();               
                 Sample y;  
                 x.i = 9;      
                 y = x;        
                 y.i = 5;              
                Console.WriteLine(x.i + y.i);             
           }   
        } 
     }
    

     

  2. A.

    9 9

    B.

    9 5

    C.

    5 5

    D.

    5 9

    E.

    None of the above

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    No answer description available for this question.


Be The First To Comment