Advertisement
Guest User

Untitled

a guest
Mar 4th, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. public static void main(String[] args)
  2. {
  3.  
  4. for(int i =1; i<=10;i += 1)
  5. {
  6. switch(i)
  7. {
  8. case 2:
  9. case 4:
  10. case 6:
  11. case 8:
  12. case 10:
  13. System.out.printf("%n%d is an even number" , i);
  14. break;
  15. default:
  16. System.out.printf("%nNot printing odd numbers!" , i);
  17.  
  18.  
  19.  
  20.  
  21. }//endSwitch
  22.  
  23.  
  24. }//endFor
  25.  
  26. //System.exit(0);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement