Rayan
2013-01-12 08:47:11 UTC
The exercise is:
Find out how many vowels has one String.
This is my code:
import java.util.Scanner;
public class Sdf {
public static void main(String[] args) {
// TODO Auto-generated method stub
char array[]=new char[50];
int j=0,k,i;
Scanner input = new Scanner(System.in);
niza = input.next().toCharArray();
for(i=0;i<100;i++)
{
if (array[i] == 'a' || array[i] == 'e' || array[i] == 'i' || array[i] == 'o' || array[i] == 'u')
j++;
}
System.out.println("The word has "+ j + " vowels.");
}
}