This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
double factorial(int); | |
int main(){ | |
int numero = 5; | |
double total; | |
total = factorial(numero); | |
printf("El factorial de %d es %d\n", numero, total); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
double factorial(int); | |
int main(){ | |
int numero = 5; | |
double total; | |
total = factorial(numero); | |
printf("El factorial de %d es %d\n", numero, total); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
/* Hacemos la declaración del prototipo de la funcion */ | |
int mcm(int, int); | |
int main(){ | |
/* Declaremos variables */ | |
int primero, segundo; | |
int resultado; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
/* Prototipo de la función */ | |
double potencia(int, int); | |
int main(){ | |
// Declaramos las variables | |
int bas = 2; | |
int expo = 3; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(){ | |
/* | |
* Para usar un archivo tenemos que asociar una variable puntero | |
* al archivo para poder escribir o leer de el | |
*/ | |
FILE *manejador_archivo = NULL; | |
/* | |
* Ahora que tenemos la variable para asignarla al archivo procedemos a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(){ | |
// Variable de archivo | |
FILE *datos = NULL; | |
// Abrimos el archivo | |
datos = fopen("/home/nomar/datos", "a"); | |
// Comprobamos que de verdad abrio | |
if(manejador_archivo == NULL ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(){ | |
// La variable de archivo | |
FILE *archivito; | |
// Variable para escribir datos en el archivo | |
char buffer[100] = "Hola Mundo"; | |
// Variable numerica | |
float numero = 3.1416; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Suponga que el contenido del archivo es: | |
* Gol | |
* Hola mundo | |
* Esto es un numero con formato 3.141 | |
* 3.141 | |
* | |
* Con esto en mente, empecemos. | |
*/ | |
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
// Esta estructura se declara global para que todas las funciones del programa | |
// tengan acceso a su definición. | |
struct formulario { | |
char nombres[200]; | |
char apellidos[200]; | |
short edad; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
// Esta estructura se declara global para que todas las funciones del programa | |
// tengan acceso a su definición. | |
struct formulario { | |
char nombres[200]; | |
char apellidos[200]; | |
short edad; | |
}; | |
OlderNewer