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

PYQ DSSSB 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);
}

  1. A.

    50

  2. B.

    60

  3. C.

    70

  4. D.

    80

Attempted by 1171 students.

Sign up free to check your answer

Sign up free

Explore the full course: Dsssb Tgt Computer Science Paper 2

Loading lesson…