Advertisement
xerpi

trololo

Jan 18th, 2012
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. double numero1;
  6. double numero2;
  7. double resultado;
  8.  
  9. void introducir_numeros();
  10. void mostrar_resultado();
  11. void sumar();
  12.  
  13. int main(){
  14.     while(1){
  15.         introducir_numeros();
  16.         sumar();
  17.         mostrar_resultado();
  18.     }
  19.     cin.get();
  20.     return 0;
  21. }
  22.  
  23. void introducir_numeros(){
  24.     cout<<"Introduce 2 numeros\n"<<endl<<"Numero 1: ";
  25.     cin>>numero1;
  26.     cout<<"\nNumero 2: ";
  27.     cin>>numero2;
  28. }
  29.  
  30. void sumar(){
  31.     resultado = numero1 + numero2;
  32. }
  33.  
  34. void  mostrar_resultado(){
  35.     cout<<"\nResultado: "<<resultado<<endl<<endl;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement