Advertisement
desislava_topuzakova

3. Animal Type

Nov 19th, 2023
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. string animal = Console.ReadLine();
  2.  
  3. //1. dog -> mammal
  4. //2. crocodile, tortoise, snake -> reptile
  5. //3. others -> unknown
  6.  
  7. if (animal == "dog")
  8. {
  9. Console.WriteLine("mammal");
  10. }
  11. else if (animal == "crocodile" || animal == "tortoise" || animal == "snake")
  12. {
  13. Console.WriteLine("reptile");
  14. }
  15. else
  16. {
  17. Console.WriteLine("unknown");
  18. }
  19.  
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement