Computer Science, asked by Sachinsachii, 14 hours ago

java program to print the number of elements in an array using scanner class.​

Answers

Answered by jeevanjoshyjose
0

Answer:

In this program, we need to count and print the number of elements present in the array.

A number of elements present in the array can be found by calculating the length of the array.

Program to print the number of elements present in an array

Length of above array is 5. Hence, the number of elements present in the array is 5.

Algorithm

Declare and initialize an array.

Calculate the length of the array that is a number of elements present in the array.

An in-built function can calculate length.

Finally, print the length of the array.

Similar questions