HristoBaychev

9chNumOddPos

Oct 5th, 2021 (edited)
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.  
  5.     int n = 10;
  6.     int count = 0;
  7.     int res = 0;
  8.     for(int temp=n; temp > 0; temp>>=1) {
  9.     if(count % 2 == 0) {
  10.         res |= (1<<count);
  11.     }
  12.     count++;
  13. }
  14.     printf("%d", (n | res));
  15.  
  16.     return 0;
  17. }
  18.  
Add Comment
Please, Sign In to add comment