Advertisement
Guest User

13. Vowel or Digit - Data Type and Variables

a guest
Sep 29th, 2016
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.11 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Exe13VowelOrDigit
  4. {
  5.     public class Exe13VowelOrDigit
  6.     {
  7.         public static void Main()
  8.         {
  9.             char question = char.Parse(Console.ReadLine());
  10.  
  11.             switch (question)
  12.             {
  13.                 case '0':
  14.                 case '1':
  15.                 case '2':
  16.                 case '3':
  17.                 case '4':
  18.                 case '5':
  19.                 case '6':
  20.                 case '7':
  21.                 case '8':
  22.                 case '9':
  23.                     Console.WriteLine("digit");
  24.                     break;
  25.  
  26.                 case 'a':
  27.                 case 'e':
  28.                 case 'i':
  29.                 case 'o':
  30.                 case 'u':
  31.                 case 'y':
  32.                 case 'A':
  33.                 case 'E':
  34.                 case 'I':
  35.                 case 'O':
  36.                 case 'U':
  37.                 case 'Y':
  38.                     Console.WriteLine("vowel");
  39.                     break;
  40.  
  41.                 default:
  42.                     Console.WriteLine("other");
  43.                     break;
  44.             }
  45.  
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement