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