BlackFriday 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
1 months ago
But wouldn't using 'return' change the behavior of the program?
upvoted 0 times
...
Louann
1 months ago
I disagree, I believe the answer is B) return a = b * c;
upvoted 0 times
...
Kasandra
1 months ago
I think the correct answer is A) a = b * c;
upvoted 0 times
...
Carman
1 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
1 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
1 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
Tamala
15 days ago
I disagree, I believe Option D is the right choice. It assigns the result to 'a' as well.
upvoted 0 times
...
Patrick
27 days ago
I think Option A is correct. It assigns the result to 'a'.
upvoted 0 times
...
...
Desmond
2 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
29 days ago
Option C and D are not correct syntax for multiplication.
upvoted 0 times
...
Arthur
1 months ago
Option A would not work because it doesn't return the value.
upvoted 0 times
...
Launa
1 months ago
I agree, option B returns the result of the multiplication.
upvoted 0 times
...
Ezekiel
1 months ago
I think option B is the correct one.
upvoted 0 times
...
...

Save Cancel