fork download
  1. #include <iostream>
  2.  
  3. int sum(int a, int b, int c=0, int d=0)
  4. {
  5. return a + b + c + d;
  6. }
  7.  
  8. int main(){
  9. std::cout << sum(4, 5, 2, 3) << '\n' ;
  10. std::cout << sum(100, -1) << '\n' ;
  11. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
14
99