Find real and imaginary number
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class xyz
{
int x, y;
public xyz(int i, int j)
{
x = i; y = j;
}
public static xyz operator +(xyz p1, xyz p2)
{
xyz r = new xyz();
r.x = p1.x + p2.x;
r.y = p1.y + p2.y;
return r;
}
public xyz()
{
}
public void display()
{
Console.WriteLine(" The value
of X : " + x + "\n" + " The value of y: " + y);
Console.ReadLine();
}
}
class P1
{
public static void Main()
{
xyz x1 = new xyz(5, 6);
xyz x2 = new xyz(3, 3);
xyz x3 = new xyz();
x3 = x1 + x2;
x3.display();
}
}
https://www.youtube.com/channel/UCKLRUr6U5OFeu7FLOpQ-FSw/videos
0 comments
Post a Comment