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

Java Class 9 Worksheet: If-Else Programs

Uploaded by

sidshah925
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)
51 views1 page

Java Class 9 Worksheet: If-Else Programs

Uploaded by

sidshah925
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

Java ICSE Class 9 Worksheet

Increment and Decrement Operators

Java ICSE Class 9 - If-Else Based Program Questions

Q1. Write a Java program to check whether a number is positive, negative or zero.

Q2. Write a program in Java to accept a number and check whether it is even or odd.

Q3. Write a Java program to input three numbers and print the greatest among them.

Q4. Write a Java program to check if a year entered by the user is a leap year or not.

Q5. Write a program to input marks of a student and display the grade as per the following:

- Marks >= 90: Grade A

- Marks >= 75 and < 90: Grade B

- Marks >= 60 and < 75: Grade C

- Marks < 60: Grade D

Q6. Write a Java program to accept the age of a person and check if they are eligible to vote (age >= 18).

Q7. Write a program to input the selling price and cost price of an item and print whether it's a profit, loss, or

no profit/loss.

Q8. Write a Java program to accept a character and check whether it is a vowel or consonant.

Q9. Write a program to input a number and check whether it is divisible by 5 and 11.

Q10. Write a program to input two numbers and a choice (1 for addition, 2 for subtraction, 3 for multiplication,

4 for division). Perform the selected operation using if-else.

You might also like