Advertisement
Guest User

Exam09

a guest
Mar 19th, 2014
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Ex09
  4. {
  5.     class Exam09
  6.     {
  7.         static void Main()
  8.         {
  9.             Console.WriteLine("0 for int, 1 for double, 2 for string!");
  10.             int a = int.Parse(Console.ReadLine());
  11.             switch (a)
  12.             {
  13.                 case 0: int b = int.Parse(Console.ReadLine()); Console.WriteLine(b+1); break;
  14.                 case 1: double c = double.Parse(Console.ReadLine()); Console.WriteLine(c + 1.00); break;
  15.                 case 2: string d = Console.ReadLine(); Console.WriteLine(d + "*"); break;
  16.                 default: Console.WriteLine("INCORECT INPUT DETAILS"); break;
  17.             }
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement