What is the output of the following code fragment?
int f1(int x, int y)
{
if(x<0 || y<0)
return x-y;
else
return f1(x-1,y) + f1(x,y-1);
}
int main()
{
cout << f1(2,1)<
}
a. 0
b. -1
c. 5
d. -5
c. 5
Computer Science & Information Technology
You might also like to view...
What is the difference between Java and Javascript? Be precise.
What will be an ideal response?
Computer Science & Information Technology
Ethical decisions in business affect which of the following?
a. the employees b. the business's clients and customers c. the suppliers and financial lenders d. all stakeholders
Computer Science & Information Technology
The __init__ method of a doubly linked list creates a node with no data.
Answer the following statement true (T) or false (F)
Computer Science & Information Technology
A social media _________ is the set of information someone provides to friends, contacts, and the public.
Fill in the blank(s) with the appropriate word(s).
Computer Science & Information Technology