Advertisement
Guest User

Untitled

a guest
Sep 16th, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. string input = "";
  2. char[] vovels = {'a','o','e','u','i'};
  3. char[] alphabet =  {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
  4. char matched_character = input.toCharArray()[0];
  5. if(alphabet.contains(matched_character)){
  6.     if(vovels.contains(matched_character)
  7.         Console.Write(input + "is a vovel");
  8.     else
  9.         Console.Write(input + "is a consonant");
  10. }
  11. else
  12.     Console.Write(input + "is not a character");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement