a guest Apr 23rd, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import*;
  2. import java.util.Scanner;
  3. class BinAdd{
  4.    pubic static void main(String[] args){
  5.     String b1,b2,sm;
  6.     Scanner s=new Scanner(;
  7.     b1=s.nextInt();
  8.     b2=s.nextInt();
  9.    int a=Integer.parseInt(b1,2);
  10.    int b=Integer.parseInt(b2,2);
  11.     int sum=a+b;
  12.     sm=Integer.toBinaryString(sum);
  13.   System.out.println(sm);
  14. }
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand