Skip to content

Instantly share code, notes, and snippets.

@Adals20
Created February 17, 2017 00:16
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 Adals20/ca29ed0bc2e456a203412ad373ba5b9a to your computer and use it in GitHub Desktop.
Save Adals20/ca29ed0bc2e456a203412ad373ba5b9a to your computer and use it in GitHub Desktop.
#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