Solution to Suppose that x, y, and z are int variables, and x = 10, y = … - Sikademy
Author Image

Archangel Macsika

Suppose that x, y, and z are int variables, and x = 10, y = 15, and z = 20. Determine whether the following expressions evaluate to true or false: a. !(x > 10) b. x <= 5 || y < 15 c. (x != 5) && (y != z) d. x >= z || (x + y >= z) e. (x <= y - 2) && (y >= z) || (z - 2 != 20)

The Answer to the Question
is below this banner.

Can't find a solution anywhere?

NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?

Get the Answers Now!

You will get a detailed answer to your question or assignment in the shortest time possible.

Here's the Solution to this Question


#include <iostream> #include <iomanip> using namespace std; int main() { int x = 10; int y = 15; int z = 20; cout <<"!(x > 10) = "<<boolalpha << !(x > 10) << endl; cout <<"x<=5||y<15 = " << boolalpha << (x <= 5 || y < 15) << endl; cout <<"(x!=5)&&(y!=z) = " << boolalpha << ((x != 5) && (y != z)) << endl; cout <<"x>=z||(x+y>=z) = " << boolalpha << (x >= z || (x + y >= z)) << endl; cout << "(x<=y-2)&&(y>=z)||(z-2!=20) = " << boolalpha << ((x <= y - 2) && (y >= z) || (z - 2 != 20)); }

Related Answers

Was this answer helpful?

Join our Community to stay in the know

Get updates for similar and other helpful Answers

Question ID: mtid-3-stid-44-sqid-1071-qpid-67