Skip to content

Instantly share code, notes, and snippets.

@Adals20
Created January 17, 2017 00:37
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/58b2c81e73c5905f7fc54fb20cdd291d to your computer and use it in GitHub Desktop.
Save Adals20/58b2c81e73c5905f7fc54fb20cdd291d to your computer and use it in GitHub Desktop.
Operaciones básicas con 2 números C++
#include <iostream>
using namespace std;
int main (){
cout << "Escriba el primer numero" << endl;
int x1;
cin >> x1;
cout << "Esbriba el segundo numero" << endl;
int x2;
cin >> x2;
cout << "Dados dos numeros se calcula: " << endl;
int x3 = x1 + x2;
cout <<"La suma de los numeros es: " << x3 << endl;
int x4 = x1 - x2;
cout <<"La diferencia entre los dos numeros: " << x4 << endl;
int x5 = x1 * x2;
cout <<"El producto de los dos numeros: " << x5 << endl;
int x6 = (x1 / x2);
cout <<"La division exacta: " << x6 << endl;
int x7 = x1 % x2;
cout <<"El residuo de la division: " << x7 << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment