anizko

04. Fruit or Vegetable

Apr 1st, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp1
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string Product = Console.ReadLine();
  10.  
  11.             if ((Product== "banana")|| (Product == "apple")|| (Product == "kiwi")||
  12.             (Product == "cherry")|| (Product == "lemon")||( Product == "grapes"))
  13.             {
  14.                 Console.WriteLine("fruit");
  15.             }
  16.             else if ((Product == "tomato")|| (Product == "cucumber")||
  17.                 (Product == "pepper")||(Product == "carrot"))
  18.             {
  19.                 Console.WriteLine("vegetable");
  20.             }
  21.             else
  22.             {
  23.                 Console.WriteLine("unknown");
  24.             }
  25.  
  26.  
  27.            
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment