Kid, after five weeks, either he's gotten the answer himself or he's given up and gone elsewhere. Regardless, we don't just give boilerplate code here and tell the OP to copy/paste.
Adding 2 Number In Java
Collapse
X
-
Use this i think it will help you. Pls follow this code
Code:import java.io.*; public class cal{ public static void main(String arg[]) throws IOException { int a=0; int b=0; int c=0; DataInputStream ds = new DataInputStream(System.in()); a =Integer.parseInt(ds.readLine()); b =Integer.parseInt(ds.readLine()); c =a+b; system.out.println(c); }Originally posted by LOVE4EVERHI PPL
I DID A SIMPLE PROGRAM THAT ADD 2 NUMBER BUT I AM HAVING PROBLEM IN ENTER THE NUMBER FROM THE USER
>>>>>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>Code:import java.io.*; public class cal{ int a=0; int b=0; int c=0; a =reader.readLine(); b =reader.readLine(); c =a+b; system.out.println(c); }
the error in the reader.readline ();
in c++ you just have to write cin>>a>>
i am new in java and i really dont know what to doComment
-
Well he never said he found the answer and it had gone of for long enough. I figured I might as well just end it. If he has questions about my code I can answer them.Originally posted by LaharlKid, after five weeks, either he's gotten the answer himself or he's given up and gone elsewhere. Regardless, we don't just give boilerplate code here and tell the OP to copy/paste.Comment
Comment