Q. What will be the output of the given code?

Code:
counter = true
while counter !=false
  puts counter
end
  • (A) TRUE
  • (B) FALSE
  • (C) Syntax Error
  • (D) Infinite Loop
πŸ’¬ Discuss
βœ… Correct Answer: (D) Infinite Loop
Explanation: Counter value is true in all cases hence true will be printed infinite times.
Explanation by: Vinay Kumar
Counter value is true in all cases hence true will be printed infinite times.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
218
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Vinay Kumar
Publisher
πŸ“ˆ
91%
Success Rate