Skip to content

Commit

Permalink
Merge pull request tarunsinghofficial#405 from raksharaj83/patch-4
Browse files Browse the repository at this point in the history
Vowelsearch
  • Loading branch information
tarunsinghofficial authored Oct 19, 2020
2 parents d2d72fc + 9b1c84e commit 7315e25
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Java_Programs_for_beginners/Vowelsearch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import java.util.Scanner;
class JavaExample
{
public static void main(String[ ] arg)
{
boolean isVowel=false;;
Scanner scanner=new Scanner(System.in);
System.out.println("Enter a character : ");
char ch=scanner.next().charAt(0);
scanner.close();
switch(ch)
{
case 'a' :
case 'e' :
case 'i' :
case 'o' :
case 'u' :
case 'A' :
case 'E' :
case 'I' :
case 'O' :
case 'U' : isVowel = true;
}
if(isVowel == true) {
System.out.println(ch+" is a Vowel");
}
else {
if((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z'))
System.out.println(ch+" is a Consonant");
else
System.out.println("Input is not an alphabet");
}
}
}

0 comments on commit 7315e25

Please sign in to comment.