Code
using System;
namespace 02_06{
public class_02_06{
struct Fraction{
public int numerator;
public int denominator;
}
public static void Main(String[] args)
{
Fraction x;
x.numerator=1;
x.denominator=2;
Fraction y=x;
Console.WriteLine("x={0}/{1}",x.numerator,x.denominator);
Console.WriteLine("y={0}/{1}",y.numerator,y.denominator);
x.numerator=3;
y.denominator=3;
Console.WriteLine("x={0}/{1}",x.numerator,x.denominator);
Console.WriteLine("y={0}/{1}",y.numerator,y.denominator);
}} }
using System;
namespace 02_06{
public class_02_06{
struct Fraction{
public int numerator;
public int denominator;
}
public static void Main(String[] args)
{
Fraction x;
x.numerator=1;
x.denominator=2;
Fraction y=x;
Console.WriteLine("x={0}/{1}",x.numerator,x.denominator);
Console.WriteLine("y={0}/{1}",y.numerator,y.denominator);
x.numerator=3;
y.denominator=3;
Console.WriteLine("x={0}/{1}",x.numerator,x.denominator);
Console.WriteLine("y={0}/{1}",y.numerator,y.denominator);
}} }