Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.samkough.java.main;
- public class Integers
- {
- public static void main(String[] args)
- {
- int myarray[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
- for (int i: myarray)
- {
- if(i == myarray[10])
- {
- System.out.println(i);
- }
- else
- {
- System.out.print(i + ", ");
- }
- }
- }
- }
- // Output: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29
Advertisement
Add Comment
Please, Sign In to add comment