
write a program that will display the exactly output as below:
Hints: declare and initialize value of array in double type.Read and write all elements of array.perform the multiply operation for each element.)
Output:
List of numbers: 1.9 3.7 5.4 7.7 9.23 11.15 23.4
After multiplication:
The numbers are: 3.8 7.4 10.8 15.4 18.46 22.30 46.8

import java.util.*;
class ArrayExample
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.println("Enter Array Elements: ");
double array[]=new double[10];
for(int i=0;i<array.length;i++){
array[i]=input.nextDouble();
}
System.out.println("After multiplication, array changes to: ");
for(int i=0;i<array.length;i++){
array[i]=array[i]*2;
System.out.println(array[i]);
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.