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 19 Discussion

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

Which code lines inserted independently instead of the comment will make the following program work correctly? (Choose three.)

Show Suggested Answer Hide Answer
Suggested Answer: A, B

Contribute your Thoughts:

Gwen
4 months ago
That's a good point. Maybe both options A and B could work, depending on the specific requirements of the program.
upvoted 0 times
...
Yuriko
4 months ago
But don't we need to specify the arguments argc and argv in the main function for it to work properly?
upvoted 0 times
...
Shaniqua
4 months ago
Haha, I bet the exam writers just want to see if we're paying attention. 'void main()' is so 1990s, but I bet someone will still choose it.
upvoted 0 times
...
Gwen
4 months ago
I disagree, I believe option B) int main (int c, char *v[]) is the correct choice.
upvoted 0 times
...
Bettina
4 months ago
Hmm, I wonder if the exam will accept 'int main(int argc, char **argv)' as an alternative to A and B. It's the same thing, just a different syntax.
upvoted 0 times
Peter
3 months ago
User 1
upvoted 0 times
...
Cassie
4 months ago
User 2
upvoted 0 times
...
Jeanice
4 months ago
User 1
upvoted 0 times
...
...
Yuriko
4 months ago
I think option A) int main (int argc, char *argv[]) will make the program work correctly.
upvoted 0 times
...
Hector
4 months ago
Yeah, D is a bit of a wild card. I'd avoid it just to be safe, though. A, B, and C are the way to go.
upvoted 0 times
Audry
3 months ago
C) int main
upvoted 0 times
...
Melissa
4 months ago
B) int main (int c, char *v[])
upvoted 0 times
...
Iluminada
4 months ago
A) int main (int argc, char *argv[])
upvoted 0 times
...
...
Chaya
4 months ago
I think D is also a valid option. Some compilers still accept the outdated 'void main()' declaration.
upvoted 0 times
Corrina
4 months ago
User 2
upvoted 0 times
...
Iola
4 months ago
User 1
upvoted 0 times
...
...
Magdalene
4 months ago
The correct options are A, B, and C. The program needs a valid main function declaration to work properly.
upvoted 0 times
Lucina
4 months ago
User 1
upvoted 0 times
...
Fletcher
4 months ago
User 2
upvoted 0 times
...
Jesse
4 months ago
User 1
upvoted 0 times
...
...

Save Cancel