Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Product {
- public static void main(String[] args)
- {
- int [] numbers = new int [3];
- int multip = 1;
- int b = 0;
- for (int c = 0; c < numbers.length; c++) {
- numbers[c] = b + 2;
- b++;
- if (c % 2 == 0 & c != 0) {
- multip *= numbers[c];
- }
- }
- System.out.println("Произведение элементов массива с чётными индексами = " + multip);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement