fork download
  1. #include <stdio.h>
  2. #include<stdlib.h>
  3.  
  4.  
  5. int * takeUserInput()
  6. {
  7. int * num = malloc(sizeof(int));
  8.  
  9. scanf("%i", num);
  10.  
  11. return num;
  12. }
  13.  
  14. int main(void)
  15. {
  16. int i;
  17. for(i = 0; i<6; i++)
  18. {
  19. int * bax = takeUserInput();
  20.  
  21. printf("your number was : %i\n", *bax);
  22. }
  23. return 0;
  24.  
  25. }
Success #stdin #stdout 0s 2428KB
stdin
5
6
7
1
2
3
stdout
your number was : 5
your number was : 6
your number was : 7
your number was : 1
your number was : 2
your number was : 3