Advertisement
MladenKarachanov

09. Fruit or Vegetable

Feb 18th, 2025
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. string product = Console.ReadLine();
  2.  
  3. if (product == "tomato" || product == "cucumber" || product == "pepper" || product == "carrot")
  4. {
  5.     Console.WriteLine("vegetable");
  6.  
  7. }
  8.  else if (product == "banana" || product == "apple" || product == "kiwi" || product == "chery"
  9.     || product == "lemon" || product == "grapes")
  10.     Console.WriteLine("fruit");
  11.  
  12.  
  13. else
  14. {
  15.  
  16.     Console.WriteLine("unknown");
  17. }
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement