Evaluate the following expressions. (2) a. 4 * 7 == 74 / 3 b. 4 + 7 / 2 <= 9 - 15 % 6 f. 3.9 / 4 - 6 >= 8 - 6.2 * 1.5

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section: Chapter Questions
Problem 3PP
icon
Related questions
Question

Evaluate the following expressions. (2)
a. 4 * 7 == 74 / 3
b. 4 + 7 / 2 <= 9 - 15 % 6
f. 3.9 / 4 - 6 >= 8 - 6.2 * 1.5

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

4.Suppose that str1, str2, and str3 are string variables, and str1 = "Low", str2 = "High", and str3 = "Medium". Evaluate the following expressions. (2, 7)
b. str1 != "low"

d. str3 > "Medium"

5.Suppose that x, y, z, and w are int variables and x = 25, y = 3, z = 12, and w = 4. What is the output of the following statements? (2, 5)
b. cout << "y != z - 9: " << (y != z - 9) << endl;
c. cout<<"x-y==z+10:"<<(x-y==z+10)<<endl;
d. cout << "!(z < w): " << !(z < w) << endl; 

6.Which of the following are not relational operators? (2)  b. ==  e. ||

7.What is the output of the following statements? (2, 3)

b. if(12 / 2 == 4 + 1) cout << "6 ";
cout << "12 / 2 != 4 + 1" << endl;

e. if("low" <= "high")
cout << "low" << endl;
cout << "high" << endl;

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning