Computer Science, asked by aliyamehar23, 1 year ago

write a program in java to accept a string .Count all the numbers excluding vowels present in the string


Vintage: ooo its a long one I'll answer it surely the next morning.....
Vintage: do you require the whole program or the logic part
aliyamehar23: yes i want whole program
Vintage: ppz select brainliest if helpful

Answers

Answered by Vintage
1
import java.util.Scanner;
public class abc
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
String s;
int ctr=0;
System.out.print("Enter the String:- ");
s=sc.nextLine();
for(i=0;i<s.length();i++)
if("AEIOUaeiou".indexOf(s.charAt(i))== -1)
ctr++;

System.out.println("Excluding vowels:- "+ctr);
}
}
Similar questions