C++ Programming - Functions - Discussion
Discussion Forum : Functions - General Questions (Q.No. 3)
3.
Which of the following statement is correct?
Discussion:
15 comments Page 2 of 2.
Vignesh mahendran said:
8 years ago
void fun(int a=10,int b=20);
void fun();
main()
{
fun();
}
So, error will occur.
void fun();
main()
{
fun();
}
So, error will occur.
Abin said:
1 decade ago
Option c is correct. It is not a matter weather the parameter is default or not!
Sonu Rajpoot said:
1 decade ago
void fun(int a=10,int b=20);
void fun();
main()
{
fun();
}
Error would occur.
void fun();
main()
{
fun();
}
Error would occur.
(1)
Aditi said:
1 decade ago
The trailing arguments of the function can have default arguments.
Pradhnya said:
9 years ago
I think option B is the correct answer.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers