Software Engineering
primer-original-v2mediumSoftware Engineering04 Looping Statementsprimer-original-v2

Software Engineering Practice Question

What will be the output for WHILE loop? BEGIN DECLARE number SET number <-- 30 WHILE number>0 number <-- number-4 END WHILE PRINT number END

Answer options

A
4
B
2
C
-2
D
0

Correct answer: 2

Explanation

Quick AnswerThe correct answer is 2 because it directly addresses the core logic of Software Engineering.

This question has been retained as-is due to its unique context.

Related Software Engineering questions

Practice more Software Engineering questions

PrimerPrep has independently reviewed practice questions and coding exercises — all free.