Vidyalelo
C++ Programming · Q28

Introduction to C++

Programming · C++ Programming · question 28

Q28

What is the correct syntax to define a function named 'add' that takes two integers as parameters and returns their sum in C++?

A.
int add(int a, b) { }
B.
int add(int a, int b) { }
Answer
C.
int add(a, b) { }
D.
None of the above

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board