What will be the output of the following program?

Loading

Practice Operator Overloading –

What will be the output of the following program?

#include 
const double CrackexamsConstant(const int, const int = 0);
int main() {
const int c = 2 ;
cout<< CrackexamsConstant(c, 10)<< " ";
cout<< CrackexamsConstant(c, 20)<< endl;
return 0;
}
const double CrackexamsConstant(const int x, const int y) {
return( (y + (y * x) * x % y) * 0.2);
}

Which of the following statement is correct about the program given

Loading

Practice Operator Overloading –

Which of the following statement is correct about the program given below?

#include 
long FactFinder(long = 5);
int main() {
for(int i = 0; i<= 0; i++)
cout<< FactFinder() << endl;
return 0;
}
long FactFinder(long x) {
if(x < 2) {
return 1;
}
long fact = 1;
for(long i = 1; i <= x-1; i++) {
fact = fact * i;
}
return fact;
}

What will be the output of the following program?

Loading

Practice Operator Overloading –

What will be the output of the following program?

#include 
int main() {
float Amount;
float Calculate(float P = 5.0, int N = 2, float R = 2.0);
Amount = Calculate();
cout<< Amount << endl;
return 0;
}
float Calculate(float P, int N, float R) {
int Year = 1;
float Sum = 1 ;
Sum = Sum * (1 + P * ++N * R);
Year = (int)(Year + Sum);
return Year;
}