ExamVeda
Login
Home
Functions and Procedures in C plus plus
?

What is the correct way to call a function named "add" that takes two parameters in C++?

Answer & Solution
Correct Answer: Option B
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

1 Comment
Saad Mansoor
Saad Mansoor 8 months ago
The given answer (Option B: add(int a, int b);) is incorrect.

add(int a, int b); is a function declaration, not a function call.

To call a function named add with two arguments a and b, the correct syntax is:
add(a, b);

Therefore, the correct answer is Option A (add(a, b);).