CS161 exam Questions and Answers | New One | Grade A+
Assuming goodData is a Boolean variable, the following two tests are logically equivalent. if (goodData == false) if (!goodData) Ans: T When a loop is nested inside another loop, the outer loop goes through all its iterations for each iteration of the inner loop. Ans: F To check if a variable has a particular value, use the = relational operator, as in the statement if (s = 3) cout "S has the value 3"; Ans: F If the operand on the left side of an || operator is true, the expression on the right side will not be checked. Ans: T The function main is always compiled first, regardless of where in the program the function main is placed. Ans: F,executed Every include directive must be followed by using namespace std; Ans: F All nested if-else statements can be converted into switch statements. Ans:
Document information
- Uploaded on
- June 17, 2024
- Number of pages
- 32
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers