fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5.  
  6. void run_times( int runs);
  7.  
  8. int main (){
  9. int i;
  10.  
  11. while ( i <3) {
  12. run_times(i);
  13. printf("Looped\n");
  14. i++;
  15. }
  16. }
  17.  
  18. void run_times( int runs) {
  19. int *x,k;
  20.  
  21. if (runs == 0) {
  22. x = &k;
  23. *x = 1;
  24. printf("X is equal to %d and k is equal to%d\n", *x, k);
  25. }
  26. if (runs == 1){
  27. printf("X is equal to %d and k is equal to%d\n", *x, k);
  28. }
  29. }
Success #stdin #stdout 0s 2112KB
stdin
Standard input is empty
stdout
X is equal to 1 and k is equal to1
Looped
X is equal to 1 and k is equal to1
Looped
Looped