Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

C++ Institute Exam CPA-21-02 Topic 4 Question 19 Discussion

Actual exam question for C++ Institute's CPA-21-02 exam
Question #: 19
Topic #: 4
[All CPA-21-02 Questions]

How many times will "HELLO" be printed?

#include

using namespace std;

int main()

{

for(int i=?1; i<=10; i++)

{

if(i < 5)

continue;

else

break;

cout<<"HELLO";

}

return 0;

}

Show Suggested Answer Hide Answer
Suggested Answer: A, B

Contribute your Thoughts:

Hmm, let's see. The loop runs from i=5 to i=10, and 'HELLO' is printed in each iteration, so the answer must be 6. Looks like C is the correct choice.
upvoted 0 times
...
Shanice
16 days ago
I'm not sure, but I think the answer is A) 1 as well
upvoted 0 times
...
Elena
18 days ago
I agree with Providencia, because the loop will only print 'HELLO' once when i=5
upvoted 0 times
...
Providencia
19 days ago
I think the answer is A) 1
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77