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
3 months 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
Rosann
2 months ago
I'm going with option D, till stack overflows.
upvoted 0 times
...
Gilma
2 months ago
I believe it will print 'HELLO' till the stack overflows.
upvoted 0 times
...
Rosann
2 months ago
Yes, I agree. It will keep printing 'HELLO' until the stack overflows.
upvoted 0 times
...
Veronika
2 months ago
I believe it will print 'HELLO' until the stack overflows as well.
upvoted 0 times
...
Leota
2 months ago
I think it will print 'HELLO' till the stack overflows.
upvoted 0 times
...
Theron
3 months ago
I think it will print 'HELLO' until the stack overflows.
upvoted 0 times
...
...
Mabel
4 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
Osvaldo
2 months ago
D) Till stack overflows
upvoted 0 times
...
Rosamond
2 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
...
Suzi
2 months ago
D) Till stack overflows
upvoted 0 times
...
Dortha
2 months ago
C) 1
upvoted 0 times
...
Billi
2 months ago
B) 32769
upvoted 0 times
...
Wilda
3 months ago
A) 65536
upvoted 0 times
...
Glynda
3 months ago
Definitely, option D is the correct choice.
upvoted 0 times
...
Vilma
3 months ago
You're right, it's a classic stack overflow scenario.
upvoted 0 times
...
Xuan
3 months ago
No way, it will print 'HELLO' till the stack overflows.
upvoted 0 times
...
Alison
3 months ago
I think it will print 'HELLO' 32769 times.
upvoted 0 times
...
...
Raina
4 months ago
I am not sure, but I think it will print 'HELLO' 65536 times.
upvoted 0 times
...
Julianna
4 months ago
I believe it will print 'HELLO' till stack overflows.
upvoted 0 times
...
Zana
4 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
3 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
...
Catina
3 months ago
D) Till stack overflows
upvoted 0 times
...
Jacinta
3 months ago
C) 1
upvoted 0 times
...
Jerilyn
3 months ago
B) 32769
upvoted 0 times
...
Bobbye
3 months ago
A) 65536
upvoted 0 times
...
...
Elise
4 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
Joye
3 months ago
Yes, that's the correct answer.
upvoted 0 times
...
Ivan
3 months ago
So, the correct option is D) Till stack overflows.
upvoted 0 times
...
Jospeh
3 months ago
I agree, the program will keep calling main() indefinitely.
upvoted 0 times
...
Verlene
4 months ago
I think it will print 'HELLO' till the stack overflows.
upvoted 0 times
...
...
Erin
4 months ago
I think it will print 'HELLO' 32769 times.
upvoted 0 times
...

Save Cancel