C++ Programming - Functions - Discussion
Discussion Forum : Functions - General Questions (Q.No. 13)
13.
Which of the following statement is correct?
Discussion:
3 comments Page 1 of 1.
Ali said:
8 years ago
Nice question, Thanks for giving it.
Shantanu.madane said:
1 decade ago
But why not B is not correct?
Arko / Judhajit said:
1 decade ago
Yes, all the parameters or arguments of a function can be default. They can already have values, and we don't need to supply any actual arguments during the Function Call.
Even if a function has only one argument, that can be a default.
Example :
int Function(int a=0); //valid.
int Function(int a=20, int b=10); //valid.
int Function(int a, int b=10); //valid, but all parameters are not default.
Even if a function has only one argument, that can be a default.
Example :
int Function(int a=0); //valid.
int Function(int a=20, int b=10); //valid.
int Function(int a, int b=10); //valid, but all parameters are not default.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers