NedyalkoKikov

Method - Demo

May 4th, 2016
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Methods
  8. {
  9. class Methods
  10. {
  11. static void Main()
  12. {
  13. Console.WriteLine("What is your name?");
  14. string name = Console.ReadLine();
  15. Console.WriteLine("How old are you?");
  16. int age = int.Parse(Console.ReadLine());
  17. Console.WriteLine("Which is your town?");
  18. string town = Console.ReadLine();
  19. Greeting(name);
  20. PrintAge(age);
  21. MyTown(town);
  22. }
  23. public static void Greeting(string name)
  24. {
  25.  
  26. Console.WriteLine($"Hello {name}");
  27. }
  28. public static void PrintAge(int age)
  29. {
  30.  
  31.  
  32. Console.WriteLine($"Youre {age} years old");
  33. }
  34. public static void MyTown(string town)
  35. {
  36.  
  37. Console.WriteLine($"My town is {town}");
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment