java program to convert binary number to its decimal equivalent

Programming Example

Write a Java Program which accept a binary number and print is equivalent Decimal Number.

import java.util.*;
class Binary2Decimal
   public static void main(String arr[])
       Scanner sc=new Scanner(;
       System.out.println("Enter any Binary Number :");
       int num=sc.nextInt();
       int dec=0,c=0,r;
       System.out.println("The Decimal Equivalent ="+dec);



Enter any Binary Number :


The Decimal Equivalent =5

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Website development Company in Allahabad Sarkari Exam Quiz