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
- A.
50
- B.
60
- C.
70
- D.
80
Attempted by 314 students.
Show answer & explanation
Correct answer: C
Loading lesson…