6 years ago in C++ Functions

Which of the following function declaration is/are incorrect?

[A] int Sum(int a, int b = 2, int c = 3);
[B] int Sum(int a = 5, int b);
[C] int Sum(int a = 0, int b, int c = 3);
[D] Both B and C are incorrect.
[E] All are correct.
Loading...
Next Question

Overall Stats

Attempted 125
Correct 26
Incorrect 26
Viewed 73

Answers

Guest
Guest
Padmavasan
Padmavasan - 2 weeks ago

Padmavasan is saying int Sum(int a, int b = 2, int c = 3); is correct answer

priyanka tile
priyanka tile - 6 months ago

priyanka tile from Nashik, India is saying Both B and C are incorrect. is correct answer

Tooba Mustafa
Tooba Mustafa - 9 months ago

Tooba Mustafa is saying Both B and C are incorrect. is correct answer

Saisha Shetty
Saisha Shetty - 9 months ago

Saisha Shetty is saying All are correct. is correct answer

indhuja indhuja
indhuja indhuja - 1 year ago

indhuja indhuja from Erode, India is saying Both B and C are incorrect. is correct answer

Related Questions

A friend function can be used to ?

  • [A] avoid arguments between classes
  • [B] allow access to classes whose source code is unavailable
  • [C] allow one class to access an unrelated class
  • [D] increase the versatility of an overloaded operator

What is true about inline functions ?

  • [A] It's a compulsion on the compiler to make function inline
  • [B] It's a request to the compiler to make te function inline
  • [C] It's the indication to the compiler that the function is recursive
  • [D] It's the indication to the compiler that the function is member function

Which of the following statement is correct?

  • [A] C++ enables to define functions that take constants as an argument.
  • [B] We cannot change the argument of the function that that are declared as constant.
  • [C] Both A and B.
  • [D] We cannot use the constant while defining the function.

Which of the following statement is correct?

  • [A] Overloaded functions can have at most one default argument.
  • [B] An overloaded function cannot have default argument.
  • [C] All arguments of an overloaded function can be default.
  • [D] A function if overloaded more than once cannot have default argument.

Dividing a program into functions

  • [A] is the key to object oriented programming
  • [B] makes the program easier to conceptualize
  • [C] makes the program run faster
  • [D] both (B) and (C)