StoimenK

C# 2.1 Ages

Jan 20th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 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 Basic_Syntax
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int age = int.Parse(Console.ReadLine());
  14.            
  15.            
  16.             if (age == 0 || age <=2)
  17.             {
  18.                 Console.WriteLine("baby");
  19.             }
  20.             else if (age <= 13)
  21.             {
  22.                 Console.WriteLine("child");
  23.             }
  24.             else if (age <= 19)
  25.             {
  26.                 Console.WriteLine("teenager");
  27.             }
  28.             else if (age <= 65)
  29.             {
  30.                 Console.WriteLine("adult");
  31.             }
  32.             else
  33.             {
  34.                 Console.WriteLine("elder");
  35.             }
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment