Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Methods
- {
- class Methods
- {
- static void Main()
- {
- Console.WriteLine("What is your name?");
- string name = Console.ReadLine();
- Console.WriteLine("How old are you?");
- int age = int.Parse(Console.ReadLine());
- Console.WriteLine("Which is your town?");
- string town = Console.ReadLine();
- Greeting(name);
- PrintAge(age);
- MyTown(town);
- }
- public static void Greeting(string name)
- {
- Console.WriteLine($"Hello {name}");
- }
- public static void PrintAge(int age)
- {
- Console.WriteLine($"Youre {age} years old");
- }
- public static void MyTown(string town)
- {
- Console.WriteLine($"My town is {town}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment