Skip to content

Commit 027d5c5

Browse files
committed
convert binary to decimal
1 parent b40f8e1 commit 027d5c5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

binary-to-decimal.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class binarytodecimal
2+
{
3+
public static void main(String args[])
4+
{
5+
String binaryString="1010";
6+
int decimal=Integer.parseInt(binaryString,2);
7+
System.out.println(decimal);
8+
}
9+
}

0 commit comments

Comments
 (0)