Control Structures IF Statement and Nested Statement

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Themes
T
Themes
Community Contributor
Quizzes Created: 1941 | Total Attempts: 1,160,425
| Questions: 30 | Updated: Aug 4, 2026
Please wait...
Question 1 / 31
🏆 Rank #--
0 %
0/100
Score 0/100

1. Given a=4, b=6, c=2, what is the result of: a < b && b > c && a < c?

Explanation

To evaluate the expression `a < b && b > c && a < c` with the given values (a=4, b=6, c=2), we check each condition. First, `a < b` (4 < 6) is TRUE. Next, `b > c` (6 > 2) is also TRUE. However, `a < c` (4 < 2) is FALSE. Since the logical AND (`&&`) requires all conditions to be TRUE for the entire expression to be TRUE, the presence of the FALSE condition results in the overall expression evaluating to FALSE.

Submit
Please wait...
About This Quiz
Control Structures If Statement and Nested Statement - Quiz

This assessment focuses on control structures, specifically IF statements and nested conditions in programming. It evaluates your understanding of key concepts like flowchart symbols, logical operators, and pseudocode syntax. Mastering these topics is essential for effective programming and decision-making in code. Enhance your skills in control structures with this targeted... see moreassessment. see less

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

2. Which operator in relational operators checks if two values are exactly equal (used in programming)?

Submit

3. With x=3.0, y=4.0, z=2.0, what is the return value of: x == 1.0 || x == 3.0?

Submit

4. In the OR truth table, which combination of inputs returns 0 (FALSE)?

Submit

5. In the AND truth table, which combination of inputs returns 1 (TRUE)?

Submit

6. Which flowchart symbol is used for assigning value and computation?

Submit

7. Which flowchart symbol is used for connecting flowcharts to other pages?

Submit

8. What are the three special control structures mentioned in the topic?

Submit

9. Which of the following correctly represents 'x is outside the range z to y'?

Submit

10. Which logical expression correctly represents 'x is in the range of z to y inclusive'?

Submit

11. With x=3.0, y=4.0, z=2.0, what is the return value of: x > z && y > z?

Submit

12. With x=3.0, y=4.0, z=2.0, what is the logical expression for 'x and y is greater than z'?

Explanation

To determine whether both x and y are greater than z, the logical expression must check each variable individually against z. The expression "x > z && y > z" accurately reflects this requirement, using the logical AND operator (&&) to ensure that both conditions must be true simultaneously. Given x=3.0, y=4.0, and z=2.0, both x and y indeed exceed z, validating the expression as true. Other options either use incorrect logical operators or do not adequately represent the condition of both x and y being greater than z.

Submit

13. Given a=4, b=6, c=2, what is the result of: !(a < b) && !(c > a)?

Explanation

To evaluate the expression `!(a < b) && !(c > a)` with the given values a=4, b=6, and c=2, we first check the conditions inside the negations. Since 4 is less than 6, `!(a < b)` becomes `!(TRUE)` which is `FALSE`. Next, since 2 is not greater than 4, `!(c > a)` becomes `!(FALSE)` which is `TRUE`. The final expression `FALSE && TRUE` evaluates to `FALSE`, hence the result is FALSE.

Submit

14. Given a=4, b=6, c=2, what is the result of: !(a < b)?

Explanation

To evaluate the expression !(a < b) with a=4 and b=6, we first determine if a is less than b. Since 4 is indeed less than 6, the expression a < b evaluates to TRUE. The logical NOT operator (!) then negates this value, resulting in FALSE. Therefore, the final output of the expression is FALSE.

Submit

15. Given a=4, b=6, c=2, what is the result of: ((a < b) && (b > c)) || c > a?

Explanation

To evaluate the expression, we first analyze the conditions. The expression is composed of two parts: (a < b) && (b > c) and c > a. Substituting the values, we find that a (4) is less than b (6), which is true, and b (6) is greater than c (2), which is also true. Thus, the first part evaluates to true. The second part, c (2) is not greater than a (4), so it evaluates to false. However, since the overall expression uses the logical OR (||), and one part is true, the final result is true.

Submit

16. What are the three basic control structures in programming?

Explanation

In programming, control structures dictate the flow of execution. Sequence refers to executing statements in a linear order. Selection allows for decision-making, enabling different paths based on conditions (e.g., if-else statements). Loop structures facilitate repeated execution of code until a specified condition is met, enhancing efficiency and reducing redundancy. Together, these three structures form the foundation for constructing complex algorithms and managing program logic.

Submit

17. What is the result of !(False)?

Explanation

The expression `!(False)` utilizes the logical NOT operator (`!`), which negates the boolean value that follows it. In this case, `False` is being negated. When you apply the NOT operator to `False`, it evaluates to `True`. Thus, the result of the expression is `True`, as negating a falsehood yields a truth.

Submit

18. What is the result of !(True)?

Explanation

The expression `!(True)` uses the logical NOT operator, which negates the value of the boolean expression it precedes. Since `True` is a boolean value representing truth, applying the NOT operator results in `False`, which represents the opposite of truth. Therefore, the result of the expression is `False`.

Submit

19. Given A=5 and B=4, what is the result of: A > B OR B > A?

Explanation

The expression "A > B OR B > A" evaluates the relationships between A and B. Given A=5 and B=4, the first part "A > B" is true since 5 is greater than 4. The second part "B > A" is false because 4 is not greater than 5. However, since the logical operator OR only requires one of the conditions to be true for the entire expression to be true, the overall result is TRUE.

Submit

20. Given A=5 and B=4, what is the result of: A > B AND B < A?

Explanation

In the expression A > B AND B < A, we evaluate both conditions. A (5) is indeed greater than B (4), making the first condition true. Simultaneously, B (4) is less than A (5), confirming the second condition is also true. Since both conditions are true, the result of the logical AND operation is true. Thus, the overall result of the expression is TRUE.

Submit

21. Given A=5 and B=4, what is the result of: A > B AND B > A?

Explanation

The expression "A > B AND B > A" evaluates two conditions. Given A=5 and B=4, the first condition "A > B" is true (5 is greater than 4), but the second condition "B > A" is false (4 is not greater than 5). For the logical AND operation to return true, both conditions must be true. Since one condition is false, the overall result is false, which is why the answer is FALSE.

Submit

22. What does the NOT (!) operator do?

Explanation

The NOT operator is a logical operator that inverts the truth value of a given expression. When applied to a variable or condition, it changes TRUE to FALSE and vice versa. This functionality is crucial in programming and logical operations, allowing for the creation of conditions that depend on the negation of existing values. For instance, if a variable evaluates to TRUE, applying the NOT operator will yield FALSE, effectively negating the original value.

Submit

23. What does the OR (||) operator require to return TRUE?

Explanation

The OR (||) operator evaluates boolean expressions and returns TRUE if at least one of the operands (variables) is TRUE. This means that if either the first variable, the second variable, or both are TRUE, the overall result will be TRUE. If both variables are FALSE, then the result will be FALSE. This characteristic makes the OR operator useful in conditions where multiple true scenarios can lead to a positive outcome.

Submit

24. What does the AND (&&) operator require to return TRUE?

Explanation

The AND (&&) operator is a logical conjunction that evaluates to TRUE only when all operands it evaluates are TRUE. This means that for an expression using the AND operator to return TRUE, every condition or variable involved must be TRUE. If even one variable is FALSE, the entire expression evaluates to FALSE. Therefore, both variables must be TRUE for the AND operator to yield a TRUE result.

Submit

25. Which operator represents 'Not Equal' in relational operators?

Explanation

In relational operators, 'Not Equal' is represented by the symbol `<>`. This operator is used to compare two values, returning true if they are not equal and false if they are equal. It is commonly used in programming and database queries to filter or evaluate conditions where inequality is required. Other symbols, such as `==`, `>=`, and `<=`, serve different purposes, such as equality and comparisons for greater or lesser values, making `<>` the appropriate choice for expressing 'Not Equal'.

Submit

26. What keyword is used in pseudocode for output operations?

Explanation

In pseudocode, the keyword "PRINT" is commonly used to denote output operations. It clearly indicates that the program will display information to the user, whether it be text, numbers, or other data types. This term is intuitive and aligns with standard programming practices, making it easily understood by those familiar with coding concepts. Other options like "DISPLAY," "WRITE," and "SHOW" may also be used in various contexts, but "PRINT" is the most widely recognized term for output in pseudocode.

Submit

27. What keyword is used in pseudocode for input operations?

Explanation

In pseudocode, the keyword "GET" is commonly used to indicate input operations, where data is retrieved from the user or another source. This term clearly conveys the action of obtaining information, making it intuitive for readers to understand that the program is expecting input. While other terms like "READ" or "INPUT" may also be used in different contexts or programming languages, "GET" is specifically recognized in pseudocode as a straightforward way to denote the process of receiving values.

Submit

28. Which flowchart symbol is used for Input/Output operations?

Explanation

In flowcharts, the parallelogram symbol is specifically designated for Input/Output operations. This shape visually represents the process of receiving input or displaying output, making it clear to the viewer that these actions are distinct from processes or decision points, which are represented by other symbols like rectangles and diamonds. The use of the parallelogram helps facilitate understanding of the flow of information within a system.

Submit

29. Which flowchart symbol represents a branching (if/else) statement?

Explanation

In flowcharting, the diamond symbol is used to represent a decision point, which is essential for branching logic like if/else statements. This shape indicates that a question or condition is evaluated, leading to different paths based on the outcome (true or false). The diamond effectively communicates that the flow of the process diverges at this point, making it a crucial element for illustrating conditional operations in algorithms.

Submit

30. Which flowchart symbol is used to denote the beginning and ending of a flowchart?

Explanation

The oval or rounded rectangle symbol is used in flowcharts to represent the start and end points of a process. Its shape signifies that the flowchart is entering or exiting a sequence of steps, clearly indicating where the process begins and where it concludes. This visual distinction helps users quickly identify the boundaries of the flowchart, enhancing understanding and navigation through the depicted workflow. Other shapes, like rectangles and diamonds, serve different functions within the flowchart, such as processes and decision points, respectively.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (30)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Given a=4, b=6, c=2, what is the result of: a < b && b > c && a...
Which operator in relational operators checks if two values are...
With x=3.0, y=4.0, z=2.0, what is the return value of: x == 1.0 || x...
In the OR truth table, which combination of inputs returns 0 (FALSE)?
In the AND truth table, which combination of inputs returns 1 (TRUE)?
Which flowchart symbol is used for assigning value and computation?
Which flowchart symbol is used for connecting flowcharts to other...
What are the three special control structures mentioned in the topic?
Which of the following correctly represents 'x is outside the range z...
Which logical expression correctly represents 'x is in the range of z...
With x=3.0, y=4.0, z=2.0, what is the return value of: x > z && y...
With x=3.0, y=4.0, z=2.0, what is the logical expression for 'x and y...
Given a=4, b=6, c=2, what is the result of: !(a < b) && !(c >...
Given a=4, b=6, c=2, what is the result of: !(a < b)?
Given a=4, b=6, c=2, what is the result of: ((a < b) && (b > c))...
What are the three basic control structures in programming?
What is the result of !(False)?
What is the result of !(True)?
Given A=5 and B=4, what is the result of: A > B OR B > A?
Given A=5 and B=4, what is the result of: A > B AND B < A?
Given A=5 and B=4, what is the result of: A > B AND B > A?
What does the NOT (!) operator do?
What does the OR (||) operator require to return TRUE?
What does the AND (&&) operator require to return TRUE?
Which operator represents 'Not Equal' in relational operators?
What keyword is used in pseudocode for output operations?
What keyword is used in pseudocode for input operations?
Which flowchart symbol is used for Input/Output operations?
Which flowchart symbol represents a branching (if/else) statement?
Which flowchart symbol is used to denote the beginning and ending of a...
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!