Home / MCQ Bank / Computer
Computer Functions And Procedures In C Plus Plus

What is the output of the following code: int sum(int a, int b) { return a + b; } cout << sum(3, 5); in C++?

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • 8

Related Computer Questions

What is the concept in OOP that allows a class to have multiple methods with the same name but different parameters in C#? To start Microsoft PowerPoint application How do you create a floating-point number in Python? What is the purpose of the AntiForgeryToken in ASP.NET MVC? What will be the output of the following Java code? class overload { int x; double y; void add(int a , int b) { x = a + b; } void add(double c , double d) { y = c + d; } overload() { this.x = 0; this.y = 0; } } class Overload_methods { public static void main(String args[]) { overload obj = new overload(); int a = 2; double b = 3.2; obj.add(a, a); obj.add(b, b); System.out.println(obj.x + " " + obj.y); } }