Tuesday, September 26, 2017

9 . WRITE A PROGRAM TO ILLUSTRATE THE USE OF DIFFERENT PROPERTIES IN C#.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Properties
{
class point
{
int getx, gety;
public int x
{
get { return getx; } set {
getx = value; }
}
public int y
{
get { return gety; } set {
gety = value; }
}
}
class Program
{
static void Main(string[] args)
{
point start = new point();
point end = new point();
start.x = 10;
start.y = 20;
end.x = 100;
end.y = 200;
Console.Write( "\npoint 1 : "+ start.x + " " + end.x);
Console.Write("\npoint 2 :"  + start.y + " " + end.y);
Console.ReadLine();
}
}
}

No comments:

Post a Comment