What will be the output of the following C++ code? #include <iostream> ...
View Question
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int Add(int X, int Y, int Z)
{
return X + Y;
}
double Add(double X, double Y, double Z)
{
return X + Y;
}
int main()
{
cout << Add(5, 6);
cout << Add(5.5, 6.6);
return 0;
}
What will be the output of the following C++ code? #include <iostream> ...
View Question
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
void print(int i)
{
cout << i;
}
void print(double f)
{
cout << f;
}
int main(void)
{
print(5);
print(500.263);
return 0;
}
What will be the output of the following C++ code? #include <iostream> ...
View QuestionFunction overloading is also similar to which of the following?
a) operator overloading b) constructor overloading c) destructor overloading d) function overloading Answer: b Explanation: In constructor overloading, ...
View QuestionIn which of the following we cannot overload the function?
a) return function b) caller c) called function d) main function Answer: a Explanation: While overloading the return ...
View QuestionWhich of the following permits function overloading on c++?
a) type b) number of arguments c) type & number of arguments d) number of objects Answer: c Explanation: ...
View Question
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
void Sum(int a, int b, int & c)
{
a = b + c;
b = a + c;
c = a + b;
}
int main()
{
int x = 2, y =3;
Sum(x, y, y);
cout << x << ” ” << y;
return 0;
}
What will be the output of the following C++ code? #include <iostream> ...
View QuestionWhat will happen when we use void in argument passing?
a) It will not return value to its caller b) It will return value to its ...
View Question
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int add(int a, int b);
int main()
{
int i = 5, j = 6;
cout << add(i, j) << endl;
return 0;
}
int add(int a, int b )
{
int sum = a + b;
a = 7;
return a + b;
}
What will be the output of the following C++ code? #include <iostream> ...
View Question
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
void square (int *x)
{
*x = (*x + 1) * (*x);
}
int main ( )
{
int num = 10;
square(&num);
cout << num;
return 0;
}
What will be the output of the following C++ code? #include <iostream> ...
View Question