Value Return has 8 Questions
#include
using namespace std;
int max(int a, int b )
{
return ( a > b ? a : b );
}
int main()
{
int i = 5;
int j = 7;
cout << max(i, j );
return 0;
}
#include
using namespace std;
double & WeeklyHours()
{
double h = 46.50;
double &hours = h;
return hours;
}
int main()
{
double hours = WeeklyHours();
cout << "Weekly Hours: " << hours;
return 0;
}
#include
using namespace std;
int mult (int x, int y)
{
int result;
result = 0;
while (y != 0) {
result = result + x;
y = y - 1;
}
return(result);
}
int main ()
{
int x = 5, y = 5;
cout << mult(x, y) ;
return(0);
}
#include
using namespace std;
int gcd (int a, int b)
{
int temp;
while (b != 0) {
temp = a % b;
a = b;
b = temp;
}
return(a);
}
int main ()
{
int x = 15, y = 25;
cout << gcd(x, y);
return(0);
}