Forum : Error in output
Brief description  about Online courses   join in Online courses
View Anusha  D R 's Profile

Error in output

import java.io.*;

class FileOutput_Add {
public static void main(String args[]) {
try {
int a,b;
FileWriter FileOut = new FileWriter("OutPutFile.txt");
BufferedWriter Output = new BufferedWriter(FileOut);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
a = (int) br.read();
b = (int) br.read();
int c = a b;
Output.write(c);
Output.close( );
}
catch (Exception e) {
System.err.println("Error: " e.getMessage());
}
}
}




this program is executing without any errors but the destination file where the addition of two numbers getting stored there i am getting an alphabets which is equivalent to the number....
Asked by Anusha D R | Sep 30, 2010 |  Reply now
Replies (3)
View anusha d-r 's Profile
Actually when i submit the program to discussion board those operators are not getting copied...
Oct 2, 2010
View anusha d-r 's Profile
Actually when i submit the program to discussion board those operators are not getting copied...
Oct 1, 2010
View arun kumar das 's Profile
Please check the statement c=a b -> I don't see any operator here.

Cheers...
JT
Oct 1, 2010