Write a program to input a string (word) from the user. Display each character in a separate line. Also count and display the vowels present in it.
Share
Write a program to input a string (word) from the user. Display each character in a separate line. Also count and display the vowels present in it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Answer:
aight, this for java
Explanation:
import java.util.*;
class Gokgok3000
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int i,vc=0;
String s;
char c;
System.out.println("Enter a string");
s=sc.next();
System.out.println("The characters :");
for(i=0;i<s.length();i++)
{
c=s.charAt(i);
System.out.println(c);
}
for(i=0;i<s.length();i++)
{
c=Character.toUpperCase(c);
if(c=='A'||c=='E'||c=='I"||c=='O'||c=='U')
{
System.out.println(c);
vc++;
}
}
System.out.println("The number of vowels:"+vc);
}
}