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 8 Question 32 Discussion

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

How many times will the program print "HELLO" ?

#include

using namespace std;

int main()

{

cout<<"HELLO";

main();

return 0;

}

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

Julianna
1 days ago
I believe it will print 'HELLO' till stack overflows.
upvoted 0 times
...
Zana
2 days ago
I think the answer is B. The program will keep printing 'HELLO' until it hits the maximum signed integer value, which is 32769.
upvoted 0 times
...
Elise
4 days ago
This is an infinite recursion problem! The program will keep calling `main()` until the stack overflows. I'm going with option D.
upvoted 0 times
...
Erin
5 days ago
I think it will print 'HELLO' 32769 times.
upvoted 0 times
...

Save Cancel