Else if Ladder Statement
The if-else-if ladder statement executes one condition from multiple statements. The execution starts from top and checked for each if condition. The statement of if block will be executed which evaluates to be true. If none of the if condition evaluates to be true then the last else block is evaluated.
Java : Else if Ladder Statement Program List
Write a program to input an integer and check whether it is greater than 100, or less than 100 or equal to 100.
Write a program to input the Selling Price and Cost Price of a commodity and find the Profit or Loss made upon selling the product.
Enter the Selling Price of the commodity: 456
Enter the Cost Price of the commodity: 400
Enter the Selling Price of the commodity: 300
Enter the Cost Price of the commodity: 310
Write a program to check whether a int type number taken as input is a positive, negative or a zero.
Write a program to accept a mark obtained by a student in computer science and print the grades accordingly:
|70 to 89||B|
|50 to 69||C|
A cloth showroom has announced the following festival discounts on the purchase of items, based on the total cost of the items purchased:
|Total Cost||Discount (in Percentage)|
|Less than ₹ 2000||5%|
|₹ 2001 to ₹ 5000||25%|
|₹ 5001 to ₹ 10000||35%|
|Above ₹ 10000||50%|
Write a program to input the total cost and compute and display the amount to be paid by the customer after availing the discount.
An electricity company charges their consumers according to the units consumed per month according to the given traffic:
|Up to 100 units||₹ 2 per unit|
|More than 100 units and up to 200 units||₹ 1.80 per unit|
|More than 200 units||₹ 1.50 per unit|
In addition to the above, every consumer has to pay ₹ 200 as Service Charge per month. Write a program to input the amount of units consumed and calculate the total charges payable (Bill) by the consumer.
A library charges a fine for books returned late. Following are the fines:
First five days : 40 paise per day.
Six to Ten days : 65 paise per day.
Above ten days : 80 paise per day.
Design a program to calculate the fine assuming that a book is returned N days late.
Write a program to input 3 unique integers and print the smallest among them