i want to read the numbers and the output would be odd and even into separate notepad.....
here's my code....
import java.io.*;
import java.util.*;
public class Vowel1 {
static int st,odd,even;
public static void main(String args[])throws IOException {
Scanner s=new Scanner (new BufferedReader(new FileReader("D:\\numbers.txt")));
BufferedReader inputStream=null;
PrintWriter outputStream=null;
PrintWriter outputStreams=null;
inputStream = new BufferedReader(new FileReader("D:\\numbers.txt"));
outputStream=new PrintWriter(new FileWriter("D:\\odd.txt"));
outputStreams=new PrintWriter(new FileWriter("D:\\even.txt"));
while(s.hasNextInt()){
st=s.nextInt();
if(st%2==0){
odd=odd+st;
}
else if ( st% 2 != ' '){
even=even+st;
}
outputStream.println(odd);
outputStreams.println(even);
}
inputStream.close();
outputStream.close();
outputStreams.close();
}
}