Write a program in java to accept a line and check how many consonants and vowels are there in line | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 2

Write a program in java to accept a line and check how many consonants and vowels are there in line

Answer this plz

17th Mar 2022, 3:42 AM
Amit Kachchhatiya
2 Réponses
+ 4
I would recommend looping through each character of the line and seeing if it equals any vowels and consonants. Create a counter variable and increase it by 1 if any of the characters equal the vowels and consonants.
17th Mar 2022, 5:09 AM
Isaac Nelson
Isaac Nelson - avatar
+ 3
Please share ur attempt so that community can help u.
17th Mar 2022, 3:44 AM
Rupali Haldiya
Rupali Haldiya - avatar