Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class OmpleArrayParells {
- public static void main (String[] args) {
- Scanner lector = new Scanner(System.in);
- System.out.print("Quin Ês el valor de \"i\"? ");
- int i = lector.nextInt();
- lector.nextLine();
- int[] array = new int[i];
- array[0] = 0;
- for(int j = 1; j < array.length; j++) {
- array[j] = array[j - 1] + 2;
- }
- for(int j = 0; j < array.length; j++) {
- System.out.println(array[j]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement