fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void func(int a,int b, int c=3);
  6. void func(int a,int b = 5, int c);
  7. void func(int a = 10, int b, int c);
  8.  
  9. void func(int a, int b, int c)
  10. {
  11. cout << "a = " << a
  12. << " b = " <<b <<" c= " <<c <<endl;
  13. }
  14.  
  15. int main()
  16. {
  17. func(20);
  18. func(15,20);
  19. func(15,20,30);
  20. func(20,30);
  21. func();
  22. return 0;
  23. }
Success #stdin #stdout 0s 2852KB
stdin
Standard input is empty
stdout
a = 20 b = 5 c= 3
a = 15 b = 20 c= 3
a = 15 b = 20 c= 30
a = 20 b = 30 c= 3
a = 10 b = 5 c= 3