Home »
MCQs »
C++ MCQs
Which of the following function will be called with the independent syntax 'sample(10,20,30);'?
74. Which of the following function will be called with the independent syntax "sample(10,20,30);"?
- void sample(int x, int y)
- void sample(int x=0, int y, int z)
- float sample(int x=0, y=0, z=0)
- void sample(int x, int y, int z=0)
Answer: D) void sample(int x, int y, int z=0)
Explanation:
In the above options, option D is correct. Option C is incorrect because the return type is "float" and the syntax given is independent which means it doesn't return any value.