Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ComplexConditionalStatements
- {
- class Program
- {
- static void Main(string[] args)
- {
- var product = Console.ReadLine();
- switch (product)
- {
- case "banana":
- case "apple":
- case "kiwi":
- case "cherry":
- case "lemon":
- case "grapes":
- {
- product = "fruit";
- }
- break;
- case "tomato":
- case "cucumber":
- case "pepper":
- case "carrot":
- {
- product = "vegetable";
- }
- break;
- default:
- {
- product = "unknown";
- }
- break;
- }
- Console.WriteLine(product);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement