ProgIng - Programación en Ingeniería
Loading...
Searching...
No Matches
Ejemplo041.c File Reference
#include <stdio.h>
Include dependency graph for Ejemplo041.c:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 3 of file Ejemplo041.c.

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}