fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. #define NUM 500000000
  5.  
  6. int main(void) {
  7. volatile int *x = malloc(sizeof(int) * NUM);
  8. int i;
  9. if (x == NULL) {
  10. perror("malloc");
  11. return 1;
  12. }
  13. x[0] = 1;
  14. for (i = 0; i < NUM; i++) {
  15. x[i] = (x[i - 1] + i) % 1234567;
  16. }
  17. printf("%d\n", x[NUM - 1]);
  18. return 0;
  19. }
Runtime error #stdin #stdout #stderr 0s 3180KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
malloc: Cannot allocate memory