0% found this document useful (0 votes)
2 views1 page

Assignment-2 Java CSE

The document outlines an assignment consisting of various programming concepts including break and continue statements, looping constructs (while, do-while, for), operator precedence, character data types, switch statements, logical operators, and nested if statements. Each question requires explanations, comparisons, and examples to illustrate the concepts effectively. The assignment aims to deepen understanding of control flow and data handling in programming.

Uploaded by

lexitkrafton
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Assignment-2 Java CSE

The document outlines an assignment consisting of various programming concepts including break and continue statements, looping constructs (while, do-while, for), operator precedence, character data types, switch statements, logical operators, and nested if statements. Each question requires explanations, comparisons, and examples to illustrate the concepts effectively. The assignment aims to deepen understanding of control flow and data handling in programming.

Uploaded by

lexitkrafton
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like