Advertisement
radidim

01.Ages (C# Shell App Paste)

Sep 26th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1. using System;
  2. namespace _01_Ages
  3. {
  4.     public class Program
  5.     {
  6.         public static void Main()
  7.         {
  8.            
  9.        // Write a program that determines whether based
  10.        //on the given age a person is: baby, child, teenager,
  11.        //adult, elder. The bounders are:
  12.             int age = int.Parse(Console.ReadLine());
  13.             if (age >=0 && age <=2)
  14.             Console.WriteLine("baby");
  15.             else if (age >=3 && age <=13)
  16.             Console.WriteLine("child");
  17.             else if (age >=14 && age <=19)
  18.             Console.WriteLine("teenager");
  19.             else if (age >= 20 && age <=65)
  20.             Console.WriteLine("adult");
  21.             else if (age >= 66)
  22.             Console.WriteLine("elder");
  23.            
  24.  
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement