Question

#include <iostream>
#include <cmath>

using namespace std;

int main()
{

int x;
int y;
int z;
int r1;
int r2;
cin >> x;
cin >> y;
cin >> z;
r1 = 4* pow(x,3)-5*pow(y,2)+3*z;
r2 = r1+7*pow(x,3)-2*pow(y,2)+11*z;

cout << "r1=";
cout << 4* pow(x,3)-5*pow(y,2)+3*z;
cout << endl;
cout << "r2=";
cout << r1+7*pow(x,3)-2*pow(y,2)+11*z;
cout << endl;
cout << "r3=";
cout << r2-9*pow(x,3)+22*pow(y,2)-6*z;
cout << endl;

return 0;
}

1-115 Your output r2-395 13-186 5:Compare output Output differs. See highlights below. -163 97218 1-1,7235 3--7.271699 1-17235 3--7271690 Input202 Your output 2--4.6562Be+07 Expected output 2-46562 6: Compare output Results hidden by your instructor

0 0
Add a comment Improve this question Transcribed image text
Answer #1
// Sample Output
   -163
   -202
   97218
 
r1=-17235354
r2=-46562793
r3=-7271690

// Code

#include <iostream>

#include <cmath>

using namespace std;

int main()

{

int x;

int y;

int z;

int r1;

int r2;

cin >> x;

cin >> y;

cin >> z;

r1 = 4* pow(x,3)-5*pow(y,2)+3*z;

r2 = r1+7*pow(x,3)-2*pow(y,2)+11*z;

cout << "r1=";

int one = 4* pow(x,3)-5*pow(y,2)+3*z;

cout << one;

cout << endl;

cout << "r2=";

int two = r1+7*pow(x,3)-2*pow(y,2)+11*z;

cout << two;

cout << endl;

cout << "r3=";

int three = r2-9*pow(x,3)+22*pow(y,2)-6*z;

cout << three;

cout << endl;

return 0;

}

Add a comment
Know the answer?
Add Answer to:
#include <iostream> #include <cmath> using namespace std; int main() { int x; int y; int z;...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT