Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class ExamQ {
- public static void main(String[] args) throws IOException {
- FileOutputStream vowel = new FileOutputStream("Vowel.txt");
- FileOutputStream constant = new FileOutputStream("Cons.txt");
- Scanner sc = new Scanner(System.in);
- System.out.println("Enter the Text:");
- String s = sc.nextLine();
- for(int i=0;i<s.length();i++){
- char temp = s.charAt(i);
- if(temp=='a'||temp=='e'||temp=='i'||temp=='o'||temp=='u'||temp=='A'||temp=='E'||temp=='I'||temp=='O'||temp=='U'){
- vowel.write(temp);
- }
- else{
- constant.write(temp);
- }
- }
- vowel.close();
- constant.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement