ProgIng - Programación en Ingeniería
Loading...
Searching...
No Matches
Ejemplo041.c
Go to the documentation of this file.
1#include <stdio.h>
2
3int main(int argc, char *argv[])
4{
5 int i, n;
6 FILE *fp;
7 printf("Ingrese el valor de n: ");
8 scanf("%d", &n);
9 fp = fopen("Prueba.txt", "wt");
10 if(fp==NULL)
11 return 1;
12 for(i=0; i<n; i++)
13 fprintf(fp, "%d\n", i+1);
14 fclose(fp);
15 return 0;
16}
int main(void)
Definition Ejemplo_035.c:15