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
- Consider Column-I and Column-II in context of C++ : Column-I Column-II i. Private a. Data type modifier ii. Sizeof b. Visibility specifier…
- Choose true statements about virtual functions in C++ : I : The virtual functions must be member of some class. II : They cannot be static…
- In context of C++, which of the following is a valid statement ?
- In C file handling equivalent to scanf("%d",&val); is :
- A variable declared within the block {} has the following scope :
- What is a copy constructor ?