Bitwise | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Bitwise

error this program

26th Feb 2018, 7:30 AM
Rafiq
5 Answers
+ 6
It occurs because of a/b in line 21. Dividing a number by zero results in error.
26th Feb 2018, 7:58 AM
Harsh
Harsh - avatar
+ 5
Which program? :-|
26th Feb 2018, 7:41 AM
Harsh
Harsh - avatar
+ 4
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?
26th Feb 2018, 1:21 PM
Harsh
Harsh - avatar
+ 1
import java.io.DataInputStream; class Bitwise667 { public static void main(String as[]) { int a=0; int b=0; DataInputStream in=new DataInputStream(System.in); 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)); } }
26th Feb 2018, 7:48 AM
Rafiq
+ 1
send me a correct program please...
26th Feb 2018, 8:11 AM
Rafiq