Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(int argc, char* argv[]) {
- int num, r, i = 0;
- int rests[256];
- char buffer[256];
- printf("Inserisci un fottuto numero: ");
- scanf("%s", buffer);
- num = atoi(buffer);
- for(; num != 0; i++) {
- r = num%2;
- num /= 2;
- rests[i] = r;
- }
- for(i-=1; i >= 0; i--)
- printf("%d", rests[i]);
- printf("\n");
- }
Add Comment
Please, Sign In to add comment