Skip to content

Instantly share code, notes, and snippets.

@jmramirezpro
Created June 3, 2016 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmramirezpro/154d94a92bb1b8084243d96e8b00b2ea to your computer and use it in GitHub Desktop.
Save jmramirezpro/154d94a92bb1b8084243d96e8b00b2ea to your computer and use it in GitHub Desktop.
/*
* 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