Vidyalelo
C# Programming · Q94

Classes and Objects in C Sharp

Programming · C# Programming · question 94

Q94

What will be the output of the following C# code? class maths public int length; public int breadth; public maths(int x, int y) length = x; breadth = y; Console.WriteLine(x + y); public maths(double x, int y) length = (int)x; breadth = y; Console.WriteLine(x * y); class Program static void Main(string[] args) maths m = new maths(20, 40); maths k = new maths(12.0, 12); Console.ReadLine();

A.
60, 24
B.
60, 0
C.
60, 144
Answer
D.
60, 144.0

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board