Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args)
- {
- for(int i =1; i<=10;i += 1)
- {
- switch(i)
- {
- case 2:
- case 4:
- case 6:
- case 8:
- case 10:
- System.out.printf("%n%d is an even number" , i);
- break;
- default:
- System.out.printf("%nNot printing odd numbers!" , i);
- }//endSwitch
- }//endFor
- //System.exit(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement