Last active
November 2, 2016 09:04
-
-
Save FloydHsiu/e37d059e5512142776b0428a9bcab3b7 to your computer and use it in GitHub Desktop.
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
int input; | |
int answer[100] | |
int counter = 0 | |
int i; | |
scanf("%d", &input); | |
while(input >= 1){ | |
answer[counter] = input % 2; | |
input = input / 2; | |
counter++; | |
} | |
for(i=counter-1; i >=0; i--){ | |
printf("%d", answer[i]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment