Answer the following statements true (T) or false (F)

1) The statement always displays x is 10, regardless of the value of x when the statement is encountered.
```
if (x = 10)
cout << "x is 10" << endl;
```
2) The value of the expression is true.
```
15< 20 || 20 >= 20
```
3) C++ has a data type named bool whose only values are true and false.
4) Evaluating only as much of an expression as is necessary is called short-circuit evaluation.
5) The code fragment on the left always gives p the same value as the code fragment on the right.
```
if (x > 15) if (x > 15)
p = p * x; p = p * x;
if (x > 30) else if (x > 30)
p = 2 * p * x; p = 2 * p * x;
```


1) T
2) T
3) T
4) T
5) F

Computer Science & Information Technology

You might also like to view...

What is a functional interface?

What will be an ideal response?

Computer Science & Information Technology

Which of the following statements is false?

a. Interface IntPredicate’s default method and performs a logical AND operation with short-circuit evaluation between the IntPredicate on which it’s called and its IntPredicate argument. b. Interface IntPredicate’s default method invert reverses the boolean value of the IntPredicate on which it’s called. c. Interface IntPredicate default method or performs a logical OR operation with short-circuit evaluation between the IntPredicate on which it’s called and its IntPredicate argument. d. You can use the interface IntPredicate default methods to compose more complex conditions.

Computer Science & Information Technology

Most programming languages are owned by a specific company or organization.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Which of the following video options is NOT included on the Video Tools Format tab?

A) Applying a style B) Cropping C) Sizing D) Looping

Computer Science & Information Technology