Patey

Untitled

Apr 13th, 2021
839
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<math.h>
  4. #include<inttypes.h>
  5. #include<stdint.h>
  6.  
  7. void changeFlag(int k, int *n)
  8. {
  9.     *n = *n ^ (1 << k);
  10. }
  11.  
  12.  
  13. int main()
  14. {
  15.     int i,n;
  16.     for (i = 1; i <= 100; i++)
  17.     {
  18.         n = i * i;
  19.         changeFlag(i-1, &n);
  20.         printf("%d\n", n);
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment