VelizarAvramov

04. Fruit or Vegetable

Mar 21st, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 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 fruitOrVegetable2
  8. {
  9.     class frOrVegetableitR
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var product = Console.ReadLine();
  14.  
  15.             if (product == "banana" || product == "apple" || product == "kiwi" || product == "cherry" || product == "lemon" || product == "grapes")
  16.             {
  17.                 Console.WriteLine("fruit");
  18.             }
  19.             else if (product == "tomato" || product == "cucumber" || product == "pepper" || product == "carrot")
  20.             {
  21.                 Console.WriteLine("vegetable");
  22.             }
  23.             else
  24.             {
  25.                 Console.WriteLine("unknown");
  26.             }
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment