JAVA PROGRAMS
1. Write a program to perform various scanner methods.
2. Write a program to perform arithmetic operators.
3. Write a program to perform literals.
4. Write a program to swap three numbers without using a third variable.
5. Write a program to compute the volume of cone.
6. Write a program to print total and average marks of 5 students.
7. Write a program to demonstrate scope of variables:
• Class instance variable
• Local variable
• Static variable
8. Write a program to demonstrate decision statements in Java:
1) Else-if ladder
2) Nested if
9. Write a program to demonstrate the control flow-
1) to print the sum of 10 natural number (using for, while & do while)
2) to determine the odd and even number (using for & while).
10. Write a program to demonstrate switch and extended switch.
11. Write a program to find the sum of 10 number using array.
12. Write a program to generate the following pattern using for loop:
1)
2)
13. Write a program to check if a number is positive, negative, or zero,
and further checks if the positive number is even or odd using nested if
and else if ladder.
14. Write a program to assign a grade based on the marks obtained by a
student using nested if and else if ladder.
15. Write a program to performs basic arithmetic operations (addition,
subtraction, multiplication, division) based on user input using switch
case.
16. Write a program to determine the number of days in a given month
using enhanced switch case.
17. Write a program that prints all characters in a string except vowels
using continue and break statement.
18. Write a program that prints numbers from 1 to 100 but skips
multiples of 5 using continue.
19. Write a program to demonstrate array.fill() method in java.
20. Write a program to print first 8 values with their index position
using for loop in java.
21. Write a program to add two matrices and stores the result in a third
matrix.
22. Write a program to search for a specific value in a 2D array.
23. Write a program to find the transpose of a matrix (rows become
columns and vice versa).