18. What is the output of the following code fragment?

int f1(int n, int m)
{
if(n < m)
return 0;
else if(n==m)
return m+ f1(n-1,m);
else
return n+ f1(n-2,m-1);
}

int main()
{
cout << f1(1,4);
return 0;
}
a. 0
b. 2
c. 4
d. 8
e. infinite recursion

a. 0

Computer Science & Information Technology

You might also like to view...

By default, a custom path animation uses which option?

A) Custom B) Scribble C) Hand drawn D) Random

Computer Science & Information Technology

Critical Thinking QuestionsCase F-1Cadence is the web master for the XYZ Corporation. She knows that links are the real strength of a website. She has created a navigation bar using a group of text links that helps viewers navigate between pages of the company's site. She has started working on the site's link structure and is adding an image map as well as button images. Cadence notices a link that is not working correctly. After verifying the link is spelled correctly, and noting that other links are working, what cause should she consider next?

A. The website may be down B. The link may have become inactive C. An Internet connection is not working properly D. All of the above

Computer Science & Information Technology