Advertisement
tsvetelinapasheva

TsvetelinaPasheva/ConditionalStatementsAdvancedLab/09.FruitOrVegetable

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