Question

Write a program using the c++ language and find the result of the following equation z=x2+y*2 ?
0 0
Add a comment Improve this question Transcribed image text
Answer #1

                       ANSWER : HERE IS THE ANSWER FOR YOUR QUESTION:

  

                       ------------------------------------------------------------------------------------------------------

        CODE:

#include <iostream>

using namespace std;

int main()
{
int x,y,z;

  
cout<<"Enter x: \n";
//input the value of x from user
cin>>x;

cout<<"Enter y: \n";
//input the value of y from user
cin>>y;
//calculating the value of z using the equation
z=x*x + y *2;

cout<<"the value of z according to the equation x*x + y*2 is = "<<z;

return 0;
}

                       -------------------------------------------------------------------------------------------------------                

                  SNIPPET

main.cpp 1 2 3 #include <iostream> 4 5 using namespace std; 6 7 int main() 8-{ 9 int x,y,z; 10 11 12 13 14 15 16 17 18 19 20

                      ---------------------------------------------------------------------------------------------------------

                  OUTPUT

Enter X: 14 Enter y: 6 the value of z according to the equation x*x + y 2 is = 28

                       -------------------------------------------------------------------------------------------------------

I hope this would help you out.

If you like my answer , please upvote

If you have any doubt, you can provide comment /feedback below the answer

Thanks

Add a comment
Know the answer?
Add Answer to:
Write a program using the c++ language and find the result of the following equation z=x2+y*2...
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