How to do input function in keyboard?

I want to input in keyboard a function. For example ; x*x+y*y . input x (example 2) and y (example 3) and this function then calculte this 2*2 + 3*3 . output 13. How to do this?
1
2
3
4
5
int x, y;
cin >> x; // type the value for x.
cin >> y; // type the value for y.
int z = x*x + y*y;
cout << z << endl; 
no this is wrong. it will be ;

1
2
3
cout << "Input a function" ;
// (we write in keyboard this) = x*x + y*y    , then press ENTER.
cin >> ....... 


an another example ;
http://sanalkurs.net/c-ile-dort-islem-yapan-bir-hesap-makinesi-yapmak-5640.html
Topic archived. No new replies allowed.