Ask Question
19 April, 22:36

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

+3
Answers (1)
  1. 19 April, 23:01
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers