aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • programming languages Online Quiz - 148
  • i=0 while i<3 print i, "\n" break end Output = 0
Multiple choice technology programming languages

i=0 while i<3 print i, "\n" break end Output = 0

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The while loop starts with i=0. It prints 0, then immediately hits 'break', which exits the loop. So only '0' is printed, matching the claimed output. The loop condition never gets re-evaluated.

Keep practicing — related questions

  • i = 0 10.times do i += 1 puts i End The output will be => 1 2 3 4 5 6 7 8 9 10
  • what is the output of the following Program
  • What is the output? X=10 while X; X=X+1 if X%2 !=0:continue Print X
  • What will be the output of the program? int I = 0; outer: while (true) { I++; inner: for (int j = 0; j < 10...
  • 0.upto(10) { |i| puts i} Output will be=> 0 1 2 3 4 5 6 7 8 9 10
  • 0.upto(10) { |i| puts I} Output will be=> 1 2 3 4 5 6 7 8 9 10
  • for ss in 1...10 print ss, " Hello\n";end => Find output? 1 Hello 2 Hello 3 Hello 4 Hello 5 Hello 6 Hello 7...
  • What will be the output of the program? int i = O; while(1) { if(i == 4) { break; } ++i; } System.out.print...
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Programming Output Evaluation (1721 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy