import java.io.*;
public class Question8
{public static void main(String args[])throws IOException
{BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Input a binary number");
int n=Integer.parseInt(br.readLine());
int s=0;
while(n>0)
{int d=n%10;
int p=0;
d*=Math.pow(2,p);
s+=d;
p++;
n/=10;
}
System.out.println("Decimal Number="+s);
}}
Find out the error from the program( Program: Conversion of Binary to decimal)
Answers
Answered by
0
you can always search the internet for your answer
hope it helps :)
Similar questions
History,
6 months ago
English,
6 months ago
Computer Science,
1 year ago
CBSE BOARD XII,
1 year ago
Math,
1 year ago