Question: Write a Java program to calculate the number of vowels in a given string.
My Answer:
import java.util.*;
import java.util.Scanner;
// Compiler version JDK 11.0.2
class Dcoder
{
public static void main(String args[])
{
Scanner input = new Scanner(System.in);
System.out.println("Enter a string: ");
String s = input.nextLine();
s=s.toLowerCase();
int vow = 0;
for(int i=0;i
char c = s.charAt(i);
if(c=='a' || c=='e' || c=='i' || c=='o' || c=='u'){
++vow;
}
}
System.out.println("Vowels in " + s + " are: " + vow);
}
}
How Many Marks Out Of 20 Can I Get?
Thank You For Your Time.
Answers
Answered by
1
Answer:
I thinck nearly 17 out of 20 you can get
Explanation:
hope it helps you plz add me in brainlist...
Similar questions
English,
3 months ago
English,
3 months ago
Math,
3 months ago
Accountancy,
6 months ago
Science,
6 months ago
English,
10 months ago
Science,
10 months ago
Social Sciences,
10 months ago