Question
Download Solution PDFIn context of C++, consider following loop-statement:
while (5) {cout <<"Hello";}
Hello will be displayed __________ time(s) by the above loop.
Answer (Detailed Solution Below)
Detailed Solution
Download Solution PDFIt is an infinite loop that will run till a break statement is issued explicitly.
while (5) corresponds to while(true)
Code:
while(5) //while(any non-zero integer)
{
/ loop runs infinitely
}
Hello, will be displayed infinite time(s) by the above loop.
Last updated on Jun 6, 2025
-> The HTET TGT Applciation Portal will reopen on 1st June 2025 and close on 5th June 2025.
-> HTET Exam Date is out. HTET TGT Exam will be conducted on 26th and 27th July 2025
-> Candidates with a bachelor's degree and B.Ed. or equivalent qualification can apply for this recruitment.
-> The validity duration of certificates pertaining to passing Haryana TET has been extended for a lifetime.
-> Enhance your exam preparation with the HTET Previous Year Papers.