Advertisement
hackloper775

Funciones M C++

Jan 14th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. /*
  2.  *
  3.  * author demianx864
  4.  * Funciones con operaciones aritméticas
  5.  */
  6.  
  7.  
  8. using namespace std;
  9.  
  10. #include <iostream>
  11.  
  12. // funciones <<
  13.  
  14. int numeros (int y,int x) {
  15.  cout << "Esta es la función uno :D\n";
  16.  return(y*x);
  17. }
  18. int mas_numeros (int y,int x) {
  19.  return (y+x);
  20. }
  21. // <<
  22.  
  23. int main () {
  24.  cout << "Operación matemática: \n" << endl;
  25.  cout << "Llamando mi función >> " << endl;
  26.  cout << "Le pasamos valores a las funciones >>" << endl;
  27.  int z = numeros(5,5);
  28.  int a = mas_numeros(10,10);
  29.  cout << "Función 1 multiplicación de 5 y 5 = " << z << endl;
  30.  cout << "Función 2 suma de 10 y 10 = " << a << endl;
  31.  cout << "División de Función 1 y 2 >>" << endl;
  32.  cout << "Resultado : " << z / a << endl;
  33.  return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement