Question: a) What does the following program do? #include using namespace std; int mystery(int, int); int main() {int x = 22; int y =15; cout <

a) What does the following program do?

#include

using namespace std;

int mystery(int, int);

int main()

{int x = 22; int y =15;

cout << "The result is " << mystery (x, y) << endl;}

int mystery(int a, int b){// b must be positive

if (b <= 10) return a;

else return (a + mystery(a + 5, b - 3));}

1b) In c++ write a statement that will print a random letter from the set: A, B, D so that the frequency of D is 50% and for A, B the frequency is 25%. Attach output image.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!