Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- double numero1;
- double numero2;
- double resultado;
- void introducir_numeros();
- void mostrar_resultado();
- void sumar();
- int main(){
- while(1){
- introducir_numeros();
- sumar();
- mostrar_resultado();
- }
- cin.get();
- return 0;
- }
- void introducir_numeros(){
- cout<<"Introduce 2 numeros\n"<<endl<<"Numero 1: ";
- cin>>numero1;
- cout<<"\nNumero 2: ";
- cin>>numero2;
- }
- void sumar(){
- resultado = numero1 + numero2;
- }
- void mostrar_resultado(){
- cout<<"\nResultado: "<<resultado<<endl<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement