Week1 Basic Java Practice Questions
Week1 Basic Java Practice Questions
D. JHASHMI
RA2311003011617
Section: G2
1.Even or Odd Number Check
ALGORITHM:
1. Start
6. End
PROGRAM:
import java.util.Scanner;
int num;
System.out.println("Enter number:");
num = sc.nextInt();
if (num % 2 == 0) {
else{
}
}
2.Age Verification:
ALGORITHM:
1. Start
2. Prompt the user to enter their age.
3. Read the input age.
4. Convert the input to an integer.
5. Check if the age is 18 or above.
6. End
4. Temperature Check:
ALGORITHM :
1. Start
2.
Initialize
the
variables.
3. Read
User
Input.
4. Check Temperature and Print Message.
5. End