DEV Community

Ivan Ivanov
Ivan Ivanov

Posted on

3. Animal Type (If Construction)

using System;

namespace AnimalType_If_
{
internal class Program
{
    static void Main(string[] args)
    {
        string animal = Console.ReadLine();

        if (animal == "dog")
        {
            Console.WriteLine("mammal");
        }
        else if (animal == "crocodile" || animal == "tortoise" || animal == "snake")
        {
            Console.WriteLine("reptile");
        }
        else
        {
            Console.WriteLine("unknown");
        }
    }
}
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)