C++ Programming - Functions - Discussion

Discussion Forum : Functions - General Questions (Q.No. 11)
11.
Where the default value of parameter have to be specified?
Function call
Function definition
Function prototype
Both B or C
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
11 comments Page 2 of 2.

Nidhi said:   1 decade ago
It should be D
becoz both are allowed
its our choice to go for B or C

void ret(int a,int b,int c);
void ret(int a,int b,int c=20)
{cout<<c<<endl;}


OR

void ret(int a,int b,int c=20);

void ret(int a,int b,int c)
{cout<<c<<endl;}


Post your comments here:

Your comments will be displayed after verification.