If Else If Ladder - Notes
If Else If Ladder - Notes
Syntax:-
if (condition 1)
statement 1/block 1
else if (condition 2)
statement 2/block 2
else if (condition 3)
statement 3/block 3
- - - - - -- - - -- - - - - - -
----------------
else if (condition n-1)
statement n-1/block n-1
else
statement n
1) WAP to input a number in the range [1-7] and print the
corresponding day of the Week.
eg. 1- Monday , 2- Tuesday ……..7-Sunday
import java.util.*; public class if1