Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package javaapplication4;
- import java.util.Scanner;
- /**
- *
- * @author pclab
- */
- public class JavaApplication4 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- Scanner kb = new Scanner(System.in);
- String line;
- char read;
- int v=0, nv=0, len,i;
- System.out.println("Enter any word ");
- line=kb.nextLine();
- len=line.length();
- for(i=0;i<line.length();i++)
- {
- switch(line.charAt(i))
- {case 'a':
- case'A':
- case'e':
- case'E':
- case'i':
- case'I':
- case'o':
- case'O':
- case'u':
- case'U':
- v++;
- break;
- default:
- nv++;
- }
- }
- System.out.println("Vowels "+v);
- System.out.println("NVowels "+nv);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement