CS202 CURRENT PAPER FINAL TERM NOTES(1)
CS202 CURRENT PAPER FINAL TERM NOTES(1)
CS202 CURRENT PAPER FINAL TERM NOTES(1)
GUARANTEED QUESTIONS
Join VU STUDY SOLUTIONS for more request-based assignments and
GDB and files for free. ( ﯾل ﷲ
ِ ﺑ
ِﺳ
َ ) ﻓﯽ
h ps://chat.whatsapp.com/LAIMHwPEHpTB1jv3cFJzQw
Question No: 1 (3 marks)
While loop and do while loop comparison
ANS:
In a while loop, the condition is checked before the loop body executes. If the condition is false initially,
the loop body may never execute.
while (condition) {
}
In a do-while loop, the condition is checked after the loop body executes. This guarantees that the loop
body executes at least once, even if the condition is false initially.
do {
}
while (condition);