1.

Correct code to be added for overloaded operator for C# .net code given below is? class csharp { int x, y, z; public csharp() { } public csharp(int a ,int b ,int c) { x = a; y = b; z = c; } Add correct set of code here public void display() { console.writeline(x + " " + y + " " + z); } class program { static void Main(String[] args) { csharp s1 = new csharp(5 ,6 ,8); csharp s3 = new csharp(); s3 = - s1; s3.display(); } } } a) public static csharp operator -(csharp s1) { csharp t = new csharp(); t.x = s1.x; t.y = s1.y; t.z = -s1.z; return t; } b) public static csharp operator -(csharp s1) { csharp t = new csharp(); t.x = s1.x; t.y = s1.y; t.z = s1.z; return t; } c) public static csharp operator -(csharp s1) { csharp t = new csharp(); t.x = -s1.x; t.y = -s1.y; t.z = -s1.z; return t; }

A. A
B. B
C. C
D. None of the mentioned
Answer» D. None of the mentioned


Discussion

No Comment Found