Created
June 3, 2016 07:43
-
-
Save jmramirezpro/154d94a92bb1b8084243d96e8b00b2ea to your computer and use it in GitHub Desktop.
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
/* | |
* FuncionIncrementar.c | |
* Ejercicios del Podcast Codigo Fuente - Programa 34 | |
* Escribir una función que incremente una variable que se le pase como parámetro | |
* Creado el 03 de jun. de 2016 | |
* Author: jmramirez | |
*/ | |
#include <stdio.h> | |
#include <math.h> | |
void incrementar (int *a){ | |
(*a) = (*a) + 1; | |
} | |
int main(void) | |
{ | |
int var; | |
printf ("Introduce un numero: \n"); | |
scanf ("%d", &var); | |
printf ("Valor del número ANTES de incrementarlo: %d\n", var); | |
incrementar (&var); | |
printf ("Valor del número DESPUES de incrementarlo: %d\n", var); | |
return (0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment