Computer Science, asked by razasayyed09rs, 1 year ago

how to take array input by usimg scanner .....syntax plz​

Answers

Answered by Shreya69614
1

public static void main (String[ ] args)

{

   Scanner input = new Scanner(System.in);

   double[ ] numbers = new double[5];

   for (int i = 0; i < numbers.length; i++)

   {

       System.out.println("Please enter number");

       numbers[i] = input.nextDouble();

   }

}


razasayyed09rs: we can use same syntax for string and other data members ?? we will just change next statement
Similar questions