Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
void Values(int n1, int n2 = 10)
4.
{
5.
using namespace std;
6.
cout
Options:
A .  trailing arguments
B .  default arguments
C .  both a & b
D .  none of the mentioned
Answer: Option B

Answer:  (a)

Explanation:  In this program, We are passing the values as by default values rules it is working.
Output:
$ g++ def2.cpp
$ a.out
1st value: 1
2nd value: 10
1st value: 3
2nd value: 4



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers