Advertisement
virtualideaz

If Else Statement

Oct 23rd, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. //
  2. //this is a decision control statement example
  3. //
  4. public class DecisionControlStatements {
  5.     public static void main(String [] args) {
  6.         //the if-else statement
  7.        
  8.         int a = 11;
  9.        
  10.         if (a <= 10)
  11.         {
  12.             System.out.println("given value : " + a);
  13.             System.out.println("The given value is less than or equal to 10");
  14.         }
  15.         else
  16.         {
  17.             System.out.println("given value : " + a);
  18.             System.out.println("The given value is greater than 10");
  19.         }
  20.     }
  21. }
  22.  
  23. --copy until here--
  24.  
  25. OUTPUT:
  26.  
  27. given value : 11
  28. The given value is greater than 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement