Program to count the total number of vowels and consonants in a string

Source Code:

public class VowelsConsonants {
public static void main(String[] args) {
String s = “education”;
int v = 0, c = 0;
s = s.toLowerCase();
for(int i=0; i= ‘a’ && ch <= 'z') {
c++;
}
}
System.out.println("Vowels: " + v + " Consonants: " + c);
}
}

Output: