Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write in c++ write the following code statements: declare a variable named x and

ID: 3860668 • Letter: W

Question

write in c++

write the following code statements:

declare a variable named x and give it the value 2

declare a variable named y and give it the value 5

write the code that will multiply X and Y and print out the resul

write the following code statements:

declare a variable named x and give it the value 2

declare a variable named y and give it the value 5

write the code that will multiply x by 2 and print out the result

write the code that will divide 8 by y and print out the result (HINT: 8/y)

write the following code statements:

declare a variable named x and give it the value 2

declare a variable named y and give it the value 5

write the code that will add X and Y and print out the result

Explanation / Answer

Hi,

Please find below the answer in the same sequence in which they are asked-

Ans 1 - x=2;

Ans 2 - y=5;

Ans 3 - cout<<x*y;

Ans 4 - x=2;

Ans 5 - y=5;

Ans 6 - cout<<x*2;

Ans 7 - x=2;

Ans 8 - y=5;

Ans 9 - cout<< x+y;

Thanks and Regards,

Vinay Singh