Advertisement
desislava_topuzakova

09. Fruit or Vegetable

Jun 18th, 2022
1,154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 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 Fruit_or_Vegetable
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string input = Console.ReadLine();
  14.             if ((input == "banana")
  15.                 ||(input == "apple")
  16.                 ||(input == "kiwi")
  17.                 || (input == "cherry")
  18.                 ||(input == "lemon")
  19.                 ||(input == "grapes"))
  20.             {
  21.                 Console.WriteLine("fruit");
  22.             }
  23.             else if ((input == "tomato")
  24.                 || (input == "cucumber")
  25.                 || (input == "pepper")
  26.                 || (input == "carrot"))
  27.  
  28.             {
  29.                 Console.WriteLine("vegetable");
  30.             }
  31.             else
  32.             {
  33.                 Console.WriteLine("unknown");
  34.             }
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement