Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the answer of each question: 1-Which of the following operators returns a logical boolean value? a)= b)! c) < d)!= e)>! 2-If variables

What is the answer of each question:

1-Which of the following operators returns a logical boolean value?

a)=

b)!

c)<

d)!=

e)>!

2-If variables p, q, and r are bool values, which of the following expressions are true?

a) ((p || q) && (p || r)) == (p || (q && r))

b) (p==q && q==r) == (p==r)

c) !!p == p

d) (!p || !q) == !(p && q)

3-Comparing two floating point values for equality using the == operator is considered poor programming practice even if the comparison works as expected.

false

true

4-false && !true || true || 4.2 < -42 && '1'+'2' == 99

false

true

4-Which C/C++ logical binary operator results in the following truth table for the following conditions?

condition 1 condition 2 ralult

false false false

false true true

true false true

true true false

5-Every 'else' must have exactly one 'if' statement that comes before it but not every 'if' must have an 'else' after it.

false

true

6-You must have braces after all conditional statements (if, else, ...) if and only if the true condition must execute multiple statements. However, your instructor feels it is good practice to use braces even if the true condition only has one statement to execute.

false

true

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

During January 2024, the following transactions occur:...

Answered: 1 week ago