imk0tter
Aug 22nd, 2025
89
0
Never
This is comment for paste #include <stdio.h> void handle_open_...
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. void handle_open_port(unsigned int x);
  4. void handle_close_port(unsigned int x);
  5.  
  6. unsigned int y = 0;
  7. unsigned int z = 0;
  8.  
  9. void kernel_recursion(unsigned int x) {
  10.     z = y;
  11.     handle_open_port(x);
  12.     if (x < y) kernel_recursion(x + 1);
  13.     handle_close_port(x);
  14.  
  15. }
  16. void kernel(unsigned int limit) {
  17.     y = z = limit;
  18.     kernel_recursion(0);
  19.     y = z = 0;
  20. }
  21.  
  22. int main() { kernel(100); }
  23.  
  24. void handle_open_port(unsigned int x) { printf("OPENING: %u\n", x); }
  25. void handle_close_port(unsigned int x) { printf("CLOSING: %u\n", x); }
Advertisement
Add Comment
Please, Sign In to add comment