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 task_9
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Please choose a type: ");
- string type = Console.ReadLine();
- switch (type)
- {
- case "1": Console.WriteLine("Please enter a integer: ");
- int input1 = int.Parse(Console.ReadLine());
- int result1 = input1 + 1;
- Console.WriteLine(result1);
- break;
- case "2": Console.WriteLine("Please enter a double: ");
- double input2 = double.Parse(Console.ReadLine());
- double result2 = input2 + 1;
- Console.WriteLine(result2);
- break;
- case "3": Console.WriteLine("Please enter a string: ");
- string input3 = Console.ReadLine();
- string result3 = input3 + "*";
- Console.WriteLine(result3);
- break;
- default: Console.WriteLine("Non a type!!!"); break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement