Created
February 17, 2017 00:16
-
-
Save Adals20/ca29ed0bc2e456a203412ad373ba5b9a 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
#include <iostream> | |
using namespace std; | |
int suma (int x1, int x2){ | |
int z; | |
return z = x1 + x2; | |
} | |
int resta (int x1, int x2){ | |
int z; | |
return z = x1 - x2; | |
} | |
int multiplicacion (int x1, int x2){ | |
int z; | |
return z = x1 * x2; | |
} | |
int divexc (int x1, int x2){ | |
int z; | |
return z = x1 / x2; | |
} | |
int residuo (int x1, int x2){ | |
int z; | |
return z = x1 % x2; | |
} | |
int main(){ | |
int x1, x2, z; | |
cout << "Escriba el primer numero: "; | |
cin >> x1; | |
cout << "Esbriba el segundo numero: "; | |
cin >> x2; | |
z = suma(x1,x2); | |
cout <<"\nLa suma de los numeros es: " << z << endl; | |
z = resta(x1,x2); | |
cout <<"La diferencia entre los dos numeros: " << z << endl; | |
z = multiplicacion(x1,x2); | |
cout <<"El producto de los dos numeros: " << z << endl; | |
z = divexc(x1,x2); | |
cout <<"La division exacta: " << z << endl; | |
z = residuo(x1,x2); | |
cout <<"El residuo de la division: " << z << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment