Computer Science, asked by Rainbowgain, 2 months ago

write a program to input an alphabet and check whether it's a constant or a vowel (java) ​

Answers

Answered by abhibagodi2005
1

Answer:

import java.util.Scanner;

class VowelConsonant

{

public static void main(String[] args)

{

char ch = 'i';

if(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' )

System.out.println(ch + " is vowel");

else

System.out.println(ch + " is consonant");

}

}

Answered by Anisha5119
6

Answer:

import java.io.*;

.*;class Character

{

{public static void main()

{public static void main(){

char c='A';

int x=(int)c;

{

if(x>=47 && x<=56)

System.out.println(c+"is a digit");

else if((x>=65&&x<=90) ||(x>=97 &&x>=122))

System.out.println(c+" is a letter");

else

System.out.println(c+" is neither a letter nor a letter");

}

}

}

Similar questions