Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
674 B
1
Indexable
Never
Console.WriteLine("Location: {0}", Location);
 }
 }
 public class C : B
 {
 public int Age;
 public void GetAge()
 {
 Console.WriteLine("Age: {0}", Age);
 }
 }
 class Program
 {
 static void Main(string[] args)
 {
 C c = new C();
 
 Console.WriteLine("Enter cricketer Details");
 Console.WriteLine("Enter Cricketer Name:");
 c.Name = Console.ReadLine();
 Console.WriteLine("Enter Cricketer Location:");
 c.Location = Console.ReadLine();
 Console.WriteLine("Enter Cricketer Age:");
 c.Age = int.Parse(Console.ReadLine());
 c.GetName();
 c.GetLocation();
 c.GetAge();
 Console.WriteLine("\nPress Any Key to Exit..");
 Console.ReadLine();
 }
 }
}
Leave a Comment