wap tp find the word with highest no. of vowels in a given sentence in java
Answers
Answered by
2
In this program, you'll learn to count the number of vowels, consonants, digits and spaces in a given sentence using if else in Java. Example: Program to count vowels, consonants, digits and spaces. ... The first if condition is to check whether the character is a vowel or not.
Explanation:
Java Program to Count the Number of Vowels and Consonants in a Sentence
public class Count {
public static void main(String[] args) {
String line = "This website is aw3som3.";
int vowels = 0, consonants = 0, digits = 0, spaces = 0;
line = line. toLowerCase();
for(int i = 0; i < line. length(); ++i)
{
char ch = line.
Similar questions