Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- long long base10to2 (int base10_number);
- int main(int argc, char const *argv[]) {
- printf("%lld\n",base10to2(3));
- return 0;
- }
- long long base10to2 (int base10_number){
- if (base10_number == 0) {
- return 0;
- }else{
- return ( base10_number % 2 + 10 * base10to2(base10_number / 2) );
- }
- }
Advertisement