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

Assignment Module-2

The document discusses different types of operators, control structures, and looping statements in Java with examples. It includes questions about arithmetic, relational, logical and bitwise operators. Questions are also asked about while and for loops, continue and break statements, if-else and switch statements, foreach loops, and using the ternary operator.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views1 page

Assignment Module-2

The document discusses different types of operators, control structures, and looping statements in Java with examples. It includes questions about arithmetic, relational, logical and bitwise operators. Questions are also asked about while and for loops, continue and break statements, if-else and switch statements, foreach loops, and using the ternary operator.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

ASSIGNMENT MODULE -2

1. What are different types of operators in java? Explain them.


2. Explain the basic arithmetic operators.
3. List and explain the relational operators.
4. List and explain logical Boolean operators.
5. Explain all bitwise operators. Consider a=3, b=6. Apply the bitwise
logical operations on these operands and print the results.
6. Explain the operation of following operators with example.
i)% ii)>>> iii)&&
7. Differentiate while-loop and for-loop in java. (OR) List and explain
different iteration statements in java.
8. Write a java program to perform simple calculator operation.
9. Discuss for-each loop with an example.
10.Demonstrate the use of:
i)Continue statement in while loop
ii)Break statement in do-while loop
(OR) Explain the following jumping statements: i)continue ii)break
Provide proper output interpretation.
(OR) with program explain the continue,break,return keywords in
java.
11.Explain the control statements: i) if-else ii) switch with example.(OR)
Explain switch case with example.
12.Write a java program to sum only first five elements of the array
using for each loop.
13.Explain ? operator with example.
(OR) with an example the ternary operator. Write a program to find
largest among 3 numbers using ternary operator
(OR) Write a program to find biggest among 3 numbers using
ternary operator.
14.Write a java program to calculate the average among the elements
2,4,6,8 using for each in java.

You might also like