fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int f()
  6. {
  7. int sum=a+b;
  8. return sum;
  9. }
  10. int main()
  11. {
  12. cout<<"Vvedite chislo ot 1 do 9 :";
  13. int a;
  14. cin>>a;
  15. cout<<"Vvedite chislo ot 1 do 9 :";
  16. int b;
  17. cin>>b;
  18. int result= f();
  19. cout<<result<<endl;
  20. }
Compilation error #stdin compilation error #stdout 0s 15232KB
stdin
3
4
compilation info
prog.cpp: In function ‘int f()’:
prog.cpp:7:10: error: ‘a’ was not declared in this scope
  int sum=a+b;
          ^
prog.cpp:7:12: error: ‘b’ was not declared in this scope
  int sum=a+b;
            ^
stdout
Standard output is empty