ASSIGNMENT - 2
Q1. Explain the use of break and continue statements. Compare their behavior inside
loops with suitable examples.
Q2. Compare all three looping statements (while, do–while, for) in terms of syntax,
execution, and use cases.
Q3. Explain operator precedence and associativity. Why are they important in expression
evaluation? Explain using suitable expressions.
Q4 Explain the character data type and ASCII codes. Discuss various character operations
and character-handling functions.
Q4. Explain the switch statement with syntax and example. Discuss the importance of break
statement and limitations of switch.
Q5. Describe logical operators in detail. Explain how compound conditions are evaluated
using truth tables and short-circuit evaluation.
Q6. Explain the if statement and two-way if–else statement in detail. Compare their
working using appropriate flowcharts and examples.
Q7. What is a nested if statement? Explain its syntax and working. Illustrate with a
program to find the largest of three numbers.