13079 - Decimal to Binary Converter Using Recursion   

Description

Convert the given decimal number (>0) to binary using recursion.

 

For example,

if we give you a decimal number 8, you have to print the corresponding binary number 1000.

 

We have provided the partial judge code (13079.c) below for you. All you need to do is complete the void dec2bin(int num) function and submit it to NTHU Online Judge System.

void dec2bin(int num){

             ...

             ...

}

 

Attention: Using recursion to solve this problem.

 

Input

Given a decimal number n, where n > 0

 

Output

Print the corresponding binary number

 

Sample Input  Download

Sample Output  Download

Partial Judge Code

13079.c

Partial Judge Header

13079.h

Tags




Discuss