Equation is (t + (z * (a5-1 + b4-1 ÷ c3-1))) = d2-1*4
question may be like
Q-
There are multiple
types of Equations in mathematical calculation in real life. Suppose you are
Software Engineer in Large Multi-National Firm. You need to perform any type of
Math calculation. For this task, Your Program that uses EQ () to find weather
Four numbers a, b, c, d is passed to the function as Value to satisfy the
Equation
(t + (z *
(a5-1 +
b4-1 ÷
c3-1)))
= d2-1*4 or Not. The
Function returns -1 if the above Equation is satisfied and returns 0
otherwise. And display Equation in the output at the end of the program.
soloution is
source code below
__________________________________________________
#include<iostream>
using namespace std;
void pow_all()
{
double a,A,b,B,C,c,D,d, lhs,rhs,z, t;
cout << "enter
value of t =";
cin >> t;
cin >> z;
cout<<"enter value of a =" ;
cin >> A;
a = pow(A,5 - 1);
cout << "enter value of b =";
cin >> B;
b = pow(B, 4 - 1);
cout << "enter value of c =";
cin >> C;
c = pow(C, 3 - 1);
cin >> D;
d = pow(D, 2 - 1*4);
lhs = (t + (z * (a + b / c)));
rhs = d;
cout << "putting value on
equation..." << endl;
cout << "(" << t << " + (" << z << " * (" << A << "^ 5-1 +" << B << " ^4-1 ÷ " << C << "3-1))) = " << D << "^2-1*4 " << endl;
cout << endl;
cout << lhs << "=" << rhs << endl;
cout << "Result=";
if (lhs == rhs)
cout << " return
1\n";
else
cout << "return
0\n";
}
void main()
{ cout << "equation is = (t + (z * (a5-1 + b4-1 ÷ c3-1))) = d2-1*4 " << endl;
pow_all();
}

1 Comments
(k)
ReplyDelete