Created
October 2, 2014 16:33
-
-
Save not-for-me/0ab0028d51d47fb7e279 to your computer and use it in GitHub Desktop.
Convert Decimal number to binary number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void decToBin(int x) { | |
if(x == 1) | |
cout << x; | |
else { | |
decToBin(x/2); | |
cout << x%2; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment