Binary to decimal

Easy
0/40
7 upvotes
Asked in companies
SamsungSnapdeal Ltd.

Problem statement

Given a binary number as an integer N, convert it into decimal and print.

Detailed explanation ( Input/output format, Notes, Images )
Input format :
An integer N in the Binary Format
Output format :
Corresponding Decimal number (as integer)
Constraints :
0 <= N <= 10^9
Sample Input 1 :
1100
Sample Output 1 :
12
Sample Input 2 :
111
Sample Output 2 :
7
Approaches (1)
Time Complexity
Space Complexity
Code Solution
(100% EXP penalty)
Binary to decimal
Full screen
Console