nerdexam
Microsoft

98-361 · Question #348

You are reviewing a C# program. The program contains the following class: public struct Rectangle { public double Length {get; set; public double Width { get; set; } } The program executes the…

The correct answer is A. 10. See the full explanation below for the reasoning.

Question

You are reviewing a C# program. The program contains the following class:

public struct Rectangle { public double Length {get; set; public double Width { get; set; } } The program executes the following code as part of the Main method:

Rectangle r1, r2; r1 = new Rectangle { Length = 10.0, Width = 20.0 }; r2 = r1; r2.Length = 30; Console.WriteLine(r1.Length); What will be the output when this code is executed?

Options

  • A10
  • B20
  • C30
  • D40

How the community answered

(28 responses)
  • A
    79% (22)
  • B
    11% (3)
  • C
    4% (1)
  • D
    7% (2)

Community Discussion

No community discussion yet for this question.

Full 98-361 Practice