Ask Question
6 September, 08:21

nt[] num = new int[100]; for (int i = 0; i < 50; i++) num[i] = i; num[5] = 10; num[55] = 100; What is the value of num. length in the array above?1. 02. 1003. 994. 101

+5
Answers (1)
  1. 6 September, 09:16
    0
    Option 2. 100 is correct.

    Explanation:

    In the above example, we have assigned the value 100 to the array num[] while creating the object of that array.

    In the next line, we are assigning the values to the array num[] through the loop which will be executed till less than 50 values as it will be started from 0 but in the next line from that we are getting the total number of elements of that array which will be 100 because length function is used to get the total number of elements in the array which is already assigned as 100.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “nt[] num = new int[100]; for (int i = 0; i < 50; i++) num[i] = i; num[5] = 10; num[55] = 100; What is the value of num. length in the array ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers