How can i give an equation to calculate?
For example:
cin>> equation;
//equation is y = 5*(x/2);
then:
cin>>x;
//x is 6;
then:
// y = 5 * ( 6 / 2 ) = 15;
cout<< y;
//y is 15;
the equation needs to be entered from input by the user.
I'm using visual studio 2010 c++ console application.
Last edited on
thank you rehan,
But the equation needs to be entered from input by the user.
You'll probably need to use some kind of interpreter of the string. I've never heard of a built-in equation system.
Yes Bourgond thank you,
I'll do that. i thought there might be some other ways.
@mrm40: Do post your code here when done, I'm curious to see it.
Last edited on