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-21-02 Topic 4 Question 26 Discussion

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

Which code line instead of the comment below will cause the program to produce the expected output?

Show Suggested Answer Hide Answer
Suggested Answer: C

Contribute your Thoughts:

Kasandra
2 months ago
But wouldn't using 'return' change the behavior of the program?
upvoted 0 times
...
Louann
2 months ago
I disagree, I believe the answer is B) return a = b * c;
upvoted 0 times
...
Kasandra
2 months ago
I think the correct answer is A) a = b * c;
upvoted 0 times
...
Carman
2 months ago
Wait, does the double asterisk in Option C mean exponentiation? If so, that's a pretty weird way to multiply two numbers. I'll stick with Option B.
upvoted 0 times
...
Leontine
2 months ago
Haha, the double asterisk in Option C made me chuckle. Is that some kind of secret code for the programmers? Anyway, I think Option B is the way to go.
upvoted 0 times
...
Sharmaine
2 months ago
I'm going with Option D. The double asterisk looks like it might be a typo, but that's the only option that actually assigns the result to the variable 'a'.
upvoted 0 times
Evan
26 days ago
User1: Hmm, I see your point. Option D does make sense now.
upvoted 0 times
...
Shala
28 days ago
User3: I'm with User2 on this one, Option D seems like the correct answer.
upvoted 0 times
...
Tamala
2 months ago
I disagree, I believe Option D is the right choice. It assigns the result to 'a' as well.
upvoted 0 times
...
Patrick
2 months ago
I think Option A is correct. It assigns the result to 'a'.
upvoted 0 times
...
...
Desmond
3 months ago
Option B makes the most sense to me. It explicitly returns the result of the multiplication, which is what the expected output seems to be looking for.
upvoted 0 times
Caren
2 months ago
Option C and D are not correct syntax for multiplication.
upvoted 0 times
...
Arthur
2 months ago
Option A would not work because it doesn't return the value.
upvoted 0 times
...
Launa
2 months ago
I agree, option B returns the result of the multiplication.
upvoted 0 times
...
Ezekiel
2 months ago
I think option B is the correct one.
upvoted 0 times
...
...

Save Cancel