Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int in,out;
  7.     scanf("%d",&in);
  8.     if (in>=0 && in<=31)
  9.     {
  10.         out=in%2;
  11.         out+=10*((in/=2)%2);
  12.         out+=100*((in/=2)%2);
  13.         out+=1000*((in/=2)%2);
  14.         out+=10000*((in/=2)%2);
  15.         printf("%d",out);
  16.     }
  17.     else
  18.         printf("Wrong Input");
  19.     return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement