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

Java Programming ModelAnswer

The document outlines a series of Java programming exercises for a lab experiment. Tasks include basic arithmetic operations, logical checks, bitwise operations, conditional statements, and control flow using loops and switch cases. The exercises aim to enhance programming skills through practical implementations.
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)
9 views1 page

Java Programming ModelAnswer

The document outlines a series of Java programming exercises for a lab experiment. Tasks include basic arithmetic operations, logical checks, bitwise operations, conditional statements, and control flow using loops and switch cases. The exercises aim to enhance programming skills through practical implementations.
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
You are on page 1/ 1

Java Lab-1 Experiment

1. Write a Java program that accepts two integers and prints their sum, difference, product, quotient,
and remainder.

2. Implement a program that checks if a number is divisible by both 3 and 5 using logical AND (&&).

3. Write a program to show the result of bitwise AND, OR, XOR, and NOT on two given integers.

4. Write a program that accepts a student's mark and prints “Pass” if it’s 40 or above, otherwise “Fail.”

5. Accept a number and check if it's positive, negative, or zero using nested if-else.

6. Create a calculator using switch that handles basic operations (+, -, *, /) based on user input.

7. Write a Java program that prints the multiplication table of a given number from 1 to 10.

8. WAP calculate the factorial of a given positive integer.

9. Simulate a simple login system where the user gets repeated chances to enter the correct password
using do-while.

10. Develop a program to print numbers from 1 to 20, skipping all multiples of 3 using continue.

You might also like