About Me

My photo
Raipur, Chhattisgarh, India
Hi , I am Amit Thakur. I have worked as a QA Engineer for two years and as a Java Developer for one year in NIHILENT TECHNOLOGIES PVT. LTD., Pune.Currently I am working as DEAN (Research & Development) in Bhilai Institute of Technology, Raipur.

Monday, April 26, 2010

JAVA(Count the No of Vowels in String)------

//Count the No of Vowels in String


import java.io.*;

class VowelsInString

{

public static void main(String dd[])throws Exception

{

String str;

int count=0;

InputStreamReader isr=new InputStreamReader(System.in);

BufferedReader br=new BufferedReader(isr);

System.out.println("Enter Your String..");

str=br.readLine();

int len=str.length();

for(int i=0;i

{

if(str.charAt(i)=='a' || str.charAt(i)=='e' || str.charAt(i)=='i' || str.charAt(i)=='o' || str.charAt(i)=='u')

{

count++;

}

}

System.out.println("Number of Vowels is "+count);

}

}

No comments: