What is the output of the following C++ code segment in Dev C++ under Windows…

2022

What is the output of the following C++ code segment in Dev C++ under Windows 10 operating system?

int sum(int a, int b=10, int c=20)
{
return a+b+c;
}
int main(){
cout<<sum(20,30);
}

Answer: C. 70

  1. A.

    50

  2. B.

    60

  3. C.

    70

  4. D.

    80

Attempted by 315 students.

Show answer & explanation

Correct answer: C

Explore the full course: Rssb Senior Computer Instructor

Loading lesson…