Advertisement
dragonbs

Ages

Feb 2nd, 2023
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. int age = int.Parse(Console.ReadLine());
  2.  
  3. if (age >= 0 && age < 3)
  4. {
  5.     Console.WriteLine("baby");
  6. }
  7.  
  8. else if (age > 2 && age < 14)
  9. {
  10.     Console.WriteLine("child");
  11. }
  12.  
  13. else if (age > 13 && age < 20)
  14. {
  15.     Console.WriteLine("teenager");
  16. }
  17.  
  18. else if (age > 19 && age < 66)
  19. {
  20.     Console.WriteLine("adult");
  21. }
  22.  
  23. else if (age > 65)
  24. {
  25.     Console.WriteLine("elder");
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement