Logo 
Search:

C++ Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C++ ProgrammingRSS Feeds

Which of the following function calls is correct while providing default arguments?

  Shared By: Aidan Campbell    Date: Feb 25    Category: C++ Programming    Views: 1027

Answer:

I. double calc(int a, float b=12.0);
II. double calc(int a=3, float b=12.0, int c);
III. double calc(int a=3, float b, int c=8);
IV. double calc(int a, float b=12.0, int c=8);


Options

a) I only
b) II only
c) Both I and IV
d) Both II, and III


Answer : c) Both I and IV

Share: 
 



Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: