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
1 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
Gilma
3 days ago
I believe it will print 'HELLO' till the stack overflows.
upvoted 0 times
...
Rosann
8 days ago
Yes, I agree. It will keep printing 'HELLO' until the stack overflows.
upvoted 0 times
...
Veronika
9 days ago
I believe it will print 'HELLO' until the stack overflows as well.
upvoted 0 times
...
Leota
13 days ago
I think it will print 'HELLO' till the stack overflows.
upvoted 0 times
...
Theron
1 months ago
I think it will print 'HELLO' until the stack overflows.
upvoted 0 times
...
...
Mabel
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
Osvaldo
3 days ago
D) Till stack overflows
upvoted 0 times
...
Rosamond
4 days 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
5 days ago
D) Till stack overflows
upvoted 0 times
...
Dortha
9 days ago
C) 1
upvoted 0 times
...
Billi
14 days ago
B) 32769
upvoted 0 times
...
Wilda
16 days ago
A) 65536
upvoted 0 times
...
Glynda
18 days ago
Definitely, option D is the correct choice.
upvoted 0 times
...
Vilma
24 days ago
You're right, it's a classic stack overflow scenario.
upvoted 0 times
...
Xuan
28 days ago
No way, it will print 'HELLO' till the stack overflows.
upvoted 0 times
...
Alison
1 months 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
23 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
24 days ago
D) Till stack overflows
upvoted 0 times
...
Jacinta
1 months ago
C) 1
upvoted 0 times
...
Jerilyn
1 months ago
B) 32769
upvoted 0 times
...
Bobbye
1 months 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
Joye
15 days ago
Yes, that's the correct answer.
upvoted 0 times
...
Ivan
17 days ago
So, the correct option is D) Till stack overflows.
upvoted 0 times
...
Jospeh
1 months ago
I agree, the program will keep calling main() indefinitely.
upvoted 0 times
...
Verlene
2 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
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