Bitwise | Sololearn: Learn to code for FREE!



error this program

2/26/2018 7:30:20 AM


5 Answers

New Answer


It occurs because of a/b in line 21. Dividing a number by zero results in error.


Which program? :-|


Well I can't make 0/0 = (whatever it might be), it is undefined and will stay that way. What are you trying to make though?


import; class Bitwise667 { public static void main(String as[]) { int a=0; int b=0; DataInputStream in=new DataInputStream(; try { System.out.println("enter value for a"); a=Integer.parseInt(in.readLine()); System.out.println("enter value for b"); b=Integer.parseInt(in.readLine()); } catch(Exception e) {} System.out.println("a="+a); System.out.println("b="+b); System.out.println("a&b="+(a&b)); System.out.println("a/b="+(a/b)); System.out.println("a^b="+(a^b)); } }


send me a correct program please...