Advertisement
Kendred

Every Other Number

Mar 6th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1.  
  2. public class Project {
  3.  
  4. public static void main(String[] args) {
  5. int [] values = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  6.  
  7. int i = 0;
  8.  
  9. while(i < 9){
  10.  
  11. System.out.println(values[i]);
  12. i = i+2 ;
  13. }
  14. }
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement