πŸ“Š Ruby
Q. What is the output of the given ruby code?
Code:
array = [100, 200, 300, 400, 500]
print array[5]
  • (A) 500
  • (B) Syntax Error
  • (C) Nil
  • (D) Name Error
πŸ’¬ Discuss
βœ… Correct Answer: (C) Nil

Explanation: Array's index start from 0 so array[5] will give nothing.

Explanation by: Yami Thakur
Array's index start from 0 so array[5] will give nothing.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
174
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Yami Thakur
Publisher
πŸ“ˆ
98%
Success Rate