C++ MQCs with Explanation (CHAPTER 4: FUNCTIONS IN C++)

Following is a list of function declarations with default values. Which one of them is a valid declaration?

  1. float mul(float a=5.0, b=10.0);
  2. float mul(int a, float b=10.0, int c);
  3. float mul(int a=5, float b);
  4. float mul(int a, float b=10.0);



Answer: 
Option a: float mul(float a=5.0, b=10.0);

Explanation Here

Post a Comment

0 Comments