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 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
2 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
3 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
3 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
3 months ago
I disagree, I believe option B) int main (int c, char *v[]) is the correct choice.
upvoted 0 times
...
Bettina
3 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
2 months ago
User 1
upvoted 0 times
...
Cassie
2 months ago
User 2
upvoted 0 times
...
Jeanice
2 months ago
User 1
upvoted 0 times
...
...
Yuriko
3 months ago
I think option A) int main (int argc, char *argv[]) will make the program work correctly.
upvoted 0 times
...
Hector
3 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
2 months ago
C) int main
upvoted 0 times
...
Melissa
2 months ago
B) int main (int c, char *v[])
upvoted 0 times
...
Iluminada
2 months ago
A) int main (int argc, char *argv[])
upvoted 0 times
...
...
Chaya
3 months ago
I think D is also a valid option. Some compilers still accept the outdated 'void main()' declaration.
upvoted 0 times
Corrina
3 months ago
User 2
upvoted 0 times
...
Iola
3 months ago
User 1
upvoted 0 times
...
...
Magdalene
3 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
3 months ago
User 1
upvoted 0 times
...
Fletcher
3 months ago
User 2
upvoted 0 times
...
Jesse
3 months ago
User 1
upvoted 0 times
...
...

Save Cancel