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:

Chandra
24 days ago
Hmm, I'm not too sure about this one. Maybe I should just ask the professor for the answer. Or maybe I can bribe the exam proctor? Just kidding, I'll go with option D.
upvoted 0 times
Theron
19 days ago
I think it will print 'HELLO' until the stack overflows.
upvoted 0 times
...
...
Mabel
1 months ago
Haha, this is a classic stack overflow question. The program will just keep printing 'HELLO' until it crashes the system. Option D all the way!
upvoted 0 times
Wilda
1 days ago
A) 65536
upvoted 0 times
...
Glynda
3 days ago
Definitely, option D is the correct choice.
upvoted 0 times
...
Vilma
9 days ago
You're right, it's a classic stack overflow scenario.
upvoted 0 times
...
Xuan
13 days ago
No way, it will print 'HELLO' till the stack overflows.
upvoted 0 times
...
Alison
26 days ago
I think it will print 'HELLO' 32769 times.
upvoted 0 times
...
...
Raina
2 months ago
I am not sure, but I think it will print 'HELLO' 65536 times.
upvoted 0 times
...
Julianna
2 months ago
I believe it will print 'HELLO' till stack overflows.
upvoted 0 times
...
Zana
2 months 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
Florinda
8 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
...
Catina
9 days ago
D) Till stack overflows
upvoted 0 times
...
Jacinta
16 days ago
C) 1
upvoted 0 times
...
Jerilyn
21 days ago
B) 32769
upvoted 0 times
...
Bobbye
23 days ago
A) 65536
upvoted 0 times
...
...
Elise
2 months 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
Yes, that's the correct answer.
upvoted 0 times
...
Ivan
2 days ago
So, the correct option is D) Till stack overflows.
upvoted 0 times
...
Jospeh
20 days ago
I agree, the program will keep calling main() indefinitely.
upvoted 0 times
...
Verlene
1 months ago
I think it will print 'HELLO' till the stack overflows.
upvoted 0 times
...
...
Erin
2 months ago
I think it will print 'HELLO' 32769 times.
upvoted 0 times
...

Save Cancel