Throws2

23/11/2009 17:18

/*******************************************************************
Program name:Write a java program to demonstrating throws
Roll no:12
*******************************************************************/
import java.io.*;
class Program2
{
public static void main(String args[])
{
try
{
BufferedReader din=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter the String:-");
String s=din.readLine();
int vcnt=0;
int l=s.length();
char ch;
for(int i=0;i<l;i++)
{
ch=s.charAt(i);
if(ch=='a'||ch=='A'||ch=='e'||ch=='E'||ch=='i'||ch=='I'||ch=='o'||ch=='O'||ch=='u'||ch=='U')
{
vcnt++;
}
}
System.out.print("The number of vowels in string is:-"+vcnt);
}
catch(Exception e)
{}
}
}

Back

Search site

Copyright © 2012 Dadaso Zanzane. All rights reserved.