[ create a new paste ] login | about

Link: http://codepad.org/ReMlyBvO    [ raw code | output | fork ]

C, pasted on Jul 31:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include<stdio.h>
#include<stdlib.h>

int main(void) {
  int num, occ, arr;
  FILE *fp;
  fp = fopen("data.io", "w");
  for (num = 0, occ = 0; num < 100; num++, occ += 10) {
    arr = occ + 20 + (double)rand() / RAND_MAX * 10 + 1;
    fprintf(fp, "%d\t%d\t%d\n", num, occ, arr);
  }
  fclose(fp);
  return 0;
}


Output:
1
Segmentation fault


Create a new paste based on this one


Comments: