Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Convert a binary number to decimal.

Easy

Problem Statement

Convert a binary number to decimal.

Sample Input

binary = 1011

Sample Output

Decimal = 11

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <stdio.h> int main() { int binary = 1011; int decimal = 0, base = 1; // Logic to convert binary to decimal return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
binary = 1011
Expected Output
Decimal = 11