Home / C# Programming / Structures :: Discussion

Discussion :: Structures

  1. Which of the following is the correct way of setting values into the structure variable e defined below?

    struct Emp 
    {   
          public String name;  
          public int age;   
          public Single sal; 
     }
      Emp e = new Emp();
    

  2. A.
     e.name = "Amol"; 
     e.age = 25; 
     e.sal = 5500;
    B.
     With e
     {   
       .name = "Amol";   
       .age = 25;    
       .sal = 5500;  
     }
    C.
    With emp e 
    {    
          .name = "Amol";   
          .age = 25;     .
           sal = 5500;  }
    D.
     e -> name = "Amol"; 
     e -> age = 25; 
     e -> sal = 5500;
    E.
     name = "Amol"; 
     age = 25;
     sal = 5500;

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    No answer description available for this question.


Be The First To Comment