Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- //this is a decision control statement example
- //
- public class DecisionControlStatements {
- public static void main(String [] args) {
- //the nested if else (if-else-if-else) statement
- int a = 11;
- if (a <= 10)
- {
- System.out.println("given value : " + a);
- System.out.println("The given value is less than or equal to 10");
- }
- else if (a >=20)
- {
- System.out.println("given value : " + a);
- System.out.println("The given value is greater than 10");
- }
- else
- {
- System.out.println("given value : " + a);
- System.out.println("The given value is neither greater than 10 nor lesser than 20");
- }
- }
- }
- --copy until here--
- OUTPUT:
- given value : 11
- The given value is neither greater than 10 nor lesser than 20
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement