Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 7, 2019 23:36
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 parzibyte/cb02d4b9ccd367551edbdb25adea7f20 to your computer and use it in GitHub Desktop.
Save parzibyte/cb02d4b9ccd367551edbdb25adea7f20 to your computer and use it in GitHub Desktop.
#include<stdio.h>
// Es una buena práctica definir el prototipo de las funciones aquí arriba
// ojo: sólo el prototipo, no el cuerpo
int sumar(int primerNumero, int segundoNumero);
int main(int argc, char const *argv[])
{
int resultado = sumar(50, 10);
printf("El resultado de la suma es %d\n", resultado);
}
// Ahora sí definimos la función con todo y cuerpo
int sumar(int primerNumero, int segundoNumero){
int suma = primerNumero + segundoNumero;
return suma;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment