Guest User

Untitled

a guest
May 27th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. #define N 100
  6.  
  7. void newArq(char *nome){
  8. int i;
  9. FILE *f = fopen(nome, "w");
  10. srand(time(NULL));
  11. for(i=1; i < 1000; i++)
  12. fprintf(f, "%d\n", rand());
  13. fprintf(f, "%d", rand());
  14. fclose(f);
  15. }
  16.  
  17. int main(){
  18. newArq("dados.txt");
  19.  
  20. system("pause");
  21. return 0;
  22. }
Add Comment
Please, Sign In to add comment