Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int i = 0, temp, k, a[15], count = 0, num, t, run;
- scanf("%d\n",&run);
- for(k = 0; k < run; k++)
- {
- scanf("%d",&num);
- temp = num;
- while(temp != 0)
- {
- count++;
- t = temp % 2;
- printf("%d\t",t);
- a[i] = t;
- i++;
- temp = temp / 2;
- }
- for(i = 0; i < count; i++) {
- printf("%d",a[i]);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement