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) { }
C. int add(a, b) { }
D. None of the above
Answer: Option B
A. int add(int a, b) { }
B. int add(int a, int b) { }
C. int add(a, b) { }
D. None of the above
Answer: Option B
What does the 'cin' object in C++ represent?
A. File output stream
B. File input stream
C. Standard output stream
D. Standard input stream
Join The Discussion