public class IntArray {
public static void main(String[] args) {
int number [] = {5, 7, 30, 40,};
int i;
int product;
int answer;
for (i = 0; i < number.length; i++) {
System.out.print(number[i] + " ");
if (number[i] >= 10)
product = number[i] * 2;
answer = product;
System.out.println(product);
}
}
}
Is it possible to multiply my array? What i really want is to have 10 elements but i tried 4 elements for trial and i want these elements to be multiplied by 2 whenever the element is greater than 10...
Thanks!