Computer Applications
What is the highest index of any array with 100 elements?
- 100
- 101
- 99
- 98
Java Arrays
2 Likes
Answer
99
Reason — Arrays are zero-indexed, meaning the first element of the array is at index 0. Therefore, an array with 100 elements has indices ranging from 0 to 99. Hence, the highest index is 99.
Answered By
1 Like
Related Questions
Arrange the following java statements in the correct order of execution to accept values into the array a[]:
(i) a[i]=sc.nextInt( );
(ii) int a[]=new int[10];
(iii) Scanner sc=new Scanner(System.in);
(iv) for(i=0;i<10;i++)- (i), (ii), (iii), (iv)
- (ii), (iii), (iv), (i)
- (iv), (iii), (ii), (i)
- (iii), (i), (iv), (ii)
In the bubble sort technique, during each iteration of the inner loop, two adjacent elements are …………… and …………… .
(i) compared
(ii) swapped
(iii) selected
(iv) deleted- (i) and (ii)
- (ii) and (iii)
- (iii) and (iv)
- (ii) and (iv)
Mr. Sanjay is an event manager, he plans and allots duties to each of his subordinates to handle different events. In a program, a task is divided into simple methods. Name the feature used in these contexts.
- Complexity
- Modularity
- Reusability
- Monolithic
Raj was asked to accept the phone number which has 10 digits, using the appropriate method of Scanner class. Which of the following statement he must choose?
- Ob.nextInt()
- Ob.nextDouble()
- Ob.nextLong()
- Ob.next().chatAt(0)