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
Math,
3 months ago
English,
3 months ago
Accountancy,
7 months ago
Science,
7 months ago
English,
11 months ago
Science,
11 months ago
Social Sciences,
11 months ago