Advertisement
tsvetelinapasheva

TsvetelinaPasheva/ConditionalStatementsAdvancedLab/03.AnimalType

Jan 24th, 2021
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp21
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string animal = Console.ReadLine();
  10.  
  11.             switch (animal)
  12.             {
  13.                 case "dog":
  14.                     Console.WriteLine("mammal");
  15.                     break;
  16.                 case "crocodile":
  17.                 case "tortoise":
  18.                 case "snake":
  19.                     Console.WriteLine("reptile");
  20.                     break;
  21.                 default:
  22.                     Console.WriteLine("unknown");
  23.                     break;
  24.             }
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement