C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Calculate The Vowels In The Given String Using Java
WhatsApp
Senthilvelan Sambamoorthy
Aug 13
2016
1.1
k
0
0
ssva26.rar
// Vowels program
import
java.io.*;
import
java.lang.String.*;
import
java.text.*;
class
ssva26
{
public
static
void
main(String arg[])
throws
IOException
{
String str;
char
s;
int
ch=
0
,l;
BufferedReader inp =
new
BufferedReader(
new
InputStreamReader(System.in));
System.out.println(
"\n\t\t\t\tCount the Vowels"
);
System.out.println(
"\n\t\t\t\t~~~~~~~~~~~~~~~~"
);
System.out.print(
"\nEnter the String: "
);
str = inp.readLine();
l=str.length();
for
(
int
i=
0
;i<l;i++)
{
s=str.charAt(i);
if
( (s==
'a'
) || (s==
'e'
) || (s==
'i'
) || (s==
'o'
) || (s==
'u'
) )
ch++;
}
System.out.println(
"\nNumber of vowels: "
+ ch);
}
}
Java
Up Next
Calculate The Vowels In The Given String Using Java