Computer Science, asked by roshanparveenbm, 10 months ago

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 mihiralways2701
0

you can always search the internet for your answer

hope it helps :)

Similar questions