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
  • Using the MARIE computer assembly language, write a program that computes the following expression: z =...

    Using the MARIE computer assembly language, write a program that computes the following expression: z = a * b * c. The computer will read in the input values a, b, and c from the keyboard and the final result (z) have to be displayed. In addition, every time an input value is read in, it must be displayed on the screen. Remember that the instruction set does not have an instruction to execute multiplication. The program must be tested...

  • Write MARIE assembly language programs that do the following: I. Write a program that inputs thre...

    Write MARIE assembly language programs that do the following: I. Write a program that inputs three integers, a, b, and c, in that order. It computes the following ia-bi-fc+ c The result should be written to output 2. Write a program that inputs integers, s. y, and z. It outputs the difference of the langest and first element entered. You may assume x. y, and z all have different values. So if 8, 12, and 9 are input, the output...

  • Using the MARIE computer assembly language, write a program that computes the following expression: z ß...

    Using the MARIE computer assembly language, write a program that computes the following expression: z ß (a * b) * (c * d). The computer will read in the input values a, b, c, and d from the keyboard, and the final result (z) has to be displayed. In addition, every time an input value is read in, it must be displayed on the screen. Each time a multiplication of two numbers is needed, it has to be done using...

  • kindly write it in c++ language. from dev c++ . Write a program to find out...

    kindly write it in c++ language. from dev c++ . Write a program to find out the factorial of an integer using loop Formula to find the factorial of an integer is: n*(n-1)*(n-2)*......... 1.

  • uploaded exercise 2 for reference 4. First write a program that achieves the same result as...

    uploaded exercise 2 for reference 4. First write a program that achieves the same result as in Exercise 2 but using a while loop. Then write a program that does this using vector operations (and no loops). If it doesn't already, make sure your program works for the case a 1 2. Let h(z, n) = 1 + x + x2 + +z" = Σ'=0a". Write an R program to calculate h(z, n) using a for loop

  • (Bonus Question) 12. Write a program that wil find the result according to the following equation...

    (Bonus Question) 12. Write a program that wil find the result according to the following equation result - +- Where n is an integer value the user will enter from keyboard.

  • C program language Plot the function y = x4 - x2 over the range -1 .2...

    C program language Plot the function y = x4 - x2 over the range -1 .2 < x < +1 . 2 Choose the y-axis scale so that the function can be seen everywhere over this x-range and yet is not so small that details are hard to see.

  • Assembly language (MIPS) Let register $8 be x and register $9 be y. Write a program...

    Assembly language (MIPS) Let register $8 be x and register $9 be y. Write a program to evaluate: Z = 3x - 5y+5 Leave the result in register $10. Inspect the register after running the program to check that the program works. Run the program several times, initialize x and y to different values for each run.

  • attached exercise 2 below for reference. 4. First write a program that achieves the same result...

    attached exercise 2 below for reference. 4. First write a program that achieves the same result as in Exercise 2 but using a while loop. Then write a program that does this using vector operations (and no loops). If it doesn't already, make sure your program works for the case a 1 2. Let h(z, n) = 1 + x + x2 + +z" = Σ'=0a". Write an R program to calculate h(z, n) using a for loop

  • CSC 211 - Lab-2 Write a C++ program to find the roots of a quadratic equation...

    CSC 211 - Lab-2 Write a C++ program to find the roots of a quadratic equation ax +bx+c=0. The roots are given by the formula, x=-b I56²-4ac 2a x = -b+ √b²-4ac 2. x2 = -b-√6²-4ac 2a Instructions: 1. Type, compile, and run the program in an online C++ compiler. 2. Open a word document and copy the following items onto it: a. The source code b. Screenshot of your program's result 3. Save the word document as lastnameFirstname_Lab2.docx (for...

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