Bitwise | Sololearn: Learn to code for FREE!

0

Bitwise

error this program

2/26/2018 7:30:20 AM

Rafiq

5 Answers

New Answer

+6

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

+5

Which program? :-|

+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?

+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)); } }

+1

send me a correct program please...