Advertisement
Guest User

C1

a guest
Feb 17th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void afisare(unsigned int a)
  5. {
  6. int i;
  7. for (i=31;i>=0;i--)
  8. printf("%d",(a>>i)&1);
  9. printf("\n");
  10.  
  11. }
  12.  
  13. void main()
  14. {
  15. int x,k=0;
  16. do{
  17. scanf("%d",&x);
  18. afisare(x);
  19. if (1<<1 && 1 << 3 && 1 << 5)
  20. {
  21. k = 1 << 2;
  22. x = x | k;
  23. k = 1 << 7 ;
  24. x = x | k;
  25. k = 1 << 8 ;
  26. x = x | k;
  27. }
  28. else
  29. {
  30.  
  31. k = 1 << 1 ;
  32. x = x | k;
  33. k = 1 << 3 ;
  34. x = x | k;
  35. k = 1 << 5 ;
  36. x = x | k;
  37.  
  38. }
  39. afisare(x);
  40. }while(x!=0);
  41.  
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement