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 feature can you use to very quickly locate and replace text in a document? Provide an example of when you might want to find text but not replace it

What will be an ideal response?

Computer Science & Information Technology

With ____, a user is tricked into giving private information about his or her account with a known large organization.?

A. ?conformity B. ?phishing C. ?deception D. ?pharming

Computer Science & Information Technology