What is the output of this program?
1. #include2. using namespace std; 3. int func(int m = 10, int n) 4. { 5. int c; 6. c = m + n; 7. return c; 8. } 9. int main() 10. { 11. cout << func(5); 12. return 0; 13. }
What is the default return type of a function ?
If we start our function call with default arguments means, what will be proceeding arguments?
What we can’t place followed by the non-default arguments?
What is the output of this program?
1. #include2. using namespace std; 3. void Values(int n1, int n2 = 10) 4. { 5. using namespace std; 6. cout << "1st value: " << n1; 7. cout << "2nd value: " << n2; 8. } 9. int main() 10. { 11. Values(1); 12. Values(3, 4); 14. return 0; 15. }
a) 1st value: 1
2nd value: 10
1st value: 3
2nd value: 4
b) 1st value: 1
2nd value: 10
1st value: 3
2nd value: 10
c) compile time error
d) none of the mentioned