Professional Documents
Culture Documents
Lista Arquivos Resolução 1
Lista Arquivos Resolução 1
h>
#include <stdlib.h>
#include <time.h>
int main()
{
srand(time(NULL));
FILE *rand_arq;
if((rand_arq = fopen("meu_rand2.txt", "w+")) == NULL)
{
printf("Falha ao abrir o arquivo.\n");
exit(0);
}
fputs("Meu arquivo randomico...\n\n", rand_arq);
}
putc('\n', rand_arq);
if(i > 0 && i%10==0)
putc('\n', rand_arq);
}
fclose(rand_arq);
printf("Arquivo randomico gerado.\n");
return 0;
}