

MCQOPTIONS
Saved Bookmarks
1. |
What will be the output of the given code snippet?
public class A { public int x; public int y; public void display() { Console.WriteLine(x + " " + y); } } class Program { static void Main(string[] args) { A obj1 = new A(); A obj2 = new A(); obj1.x = 1; obj1.y = 2; obj2 = obj1; obj1.display(); obj2.display(); } }class Program { static void Main(string[] args) { double x = 3.14; int y = (int) Math.Abs(x); Console.WriteLine(y); } } |
A. | 0 |
B. | 3 |
C. | 3.0 |
D. | 3.1 |
Answer» C. 3.0 | |