0
I wrote the below code
But i could not figure out what it does. Can anyone tell me please import java.io.*; public class NumberOfNegative{ public static void main(String[] args)throws Exception{ BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String s1 = reader.readLine(); String s2 = reader.readLine(); int a = Integer.parseInt(s1); int b = Integer.parseInt(s2); if(a>0 && b>0){ System.out.println(1); } else if(a<0 && b>0){ System.out.println(2); } else if(a<0 && b<0){ System.out.println(3); } else if(a>0 && b>0){ System.out.println(2); } } }
6 Answers
0
I swear i wrote it man. Some months back
0
But that time i guess i dont run it...
0
I understand your 1 and 2. But i m not sure about the condition check. I believe i wrote it to check for negative number or somethin