All mock tests are FREE till 31 December — register to save your progress
Unit 3 · Programming Concepts & Python HTET 2022 PGT Computer Science

How many times 'save trees' will be displayed by C++ loop ?

do { cout << "save trees"; } while(0);

C++ लूप के द्वारा 'save trees' कितनी बार प्रदर्शित किया जायेगा ?

do { cout << "save trees"; } while(0);

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. Oneएक

Explanation

A do-while loop runs its body once before testing the condition. while(0) is false, so "save trees" prints exactly once.

do-while लूप शर्त जाँचने से पहले एक बार चलता है। while(0) असत्य है, इसलिए "save trees" केवल एक बार छपेगा।

More Programming Concepts & Python questions