Cyber Monday 2024! 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 Topic 1 Question 81 Discussion

Actual exam question for C++ Institute's CPA exam
Question #: 81
Topic #: 1
[All CPA Questions]

What happens when you attempt to compile and run the following code?

#include

using namespace std;

int main()

{

const char *s;

char str[] = "Hello";

s = str;

while(*s) {

cout << *s++;

}

return 0;

}

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

Tu
6 months ago
I think it will print 'o'.
upvoted 0 times
...
Donette
6 months ago
I'm confident it will print 'Hello'.
upvoted 0 times
...
Blondell
7 months ago
I'm not sure, but I think it will print 'el'.
upvoted 0 times
...
Franklyn
7 months ago
I believe it will print 'H'.
upvoted 0 times
...
Tracey
7 months ago
I think the code will print 'Hello'.
upvoted 0 times
...

Save Cancel