Method inside structure
using System;
public struct My_Details
{
public float f;
public string s;
public int i;
public void Sub()
{
Console.WriteLine("this method is for substraction");
}
}
class Sum
{
public static void Main()
{
My_Details m=new My_Details();
m.f=float.Parse(Console.ReadLine());
m.s="hi this is stiring data";
Console.WriteLine(m.s+m.f);
m.Sub();
}
}
No comments:
Post a Comment