fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int numero; // global variable disponible a cualquier función
  6.  
  7. void funcion_1() {
  8. numero += 10;
  9. }
  10.  
  11. void funcion_2() {
  12. numero += 20;
  13. }
  14.  
  15. int main() {
  16. numero = 200;
  17. cout << numero << endl;
  18.  
  19. numero = 100;
  20. funcion_1();
  21. cout << numero << endl;
  22.  
  23. numero = 10;
  24. funcion_2();
  25. cout << numero << endl;
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
200
110
30