X

DAYS

:

HOUR

:

MINS

:

SEC

Copied to Clipboard
Decimal to binary
Basic Accuracy: 66.43% Submissions: 2580 Points: 1

Given a decimal number N, compute its binary equivalent.


Example 1:
Input: N = 7
Output: 111

 

Example 2:
Input: N = 33
Output: 100001

 

Your Task:
You dont need to read input or print anything. Complete the function toBinary() which takes the decimal number N as input parameter and returns its binary equivalent.

 

We are replacing the old Disqus forum with the new Discussions section given below.
Click here to view old Disqus comments.


to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Decimal to binary

Output Window