Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. // Es una buena práctica definir el prototipo de las funciones aquí arriba
  4. // ojo: sólo el prototipo, no el cuerpo
  5. int sumar(int primerNumero, int segundoNumero);
  6.  
  7. int main(int argc, char const *argv[])
  8. {
  9. int resultado = sumar(50, 10);
  10. printf("El resultado de la suma es %d\n", resultado);
  11. }
  12.  
  13. // Ahora sí definimos la función con todo y cuerpo
  14. int sumar(int primerNumero, int segundoNumero){
  15. int suma = primerNumero + segundoNumero;
  16. return suma;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement