Skip to content

Instantly share code, notes, and snippets.

@not-for-me
Created October 2, 2014 16:33
Show Gist options
  • Save not-for-me/0ab0028d51d47fb7e279 to your computer and use it in GitHub Desktop.
Save not-for-me/0ab0028d51d47fb7e279 to your computer and use it in GitHub Desktop.
Convert Decimal number to binary number
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