#include <iostream>#include <cmath>using namespace std; int f(){ int sum=a+b; return sum;}int main(){ cout<<"Vvedite chislo ot 1 do 9 :"; int a; cin>>a; cout<<"Vvedite chislo ot 1 do 9 :"; int b; cin>>b; int result= f(); cout<<result<<endl;}
3 4
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; ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!