What is the output of the following code fragment?

int f1(int base, int limit)
{
if(base > limit)
return -1;
else
if(base == limit)
return 1;
else
return base * f1(base+2, limit);
}

int main()
{
cout << f1(2,4)< return 0;
}


2

Computer Science & Information Technology

You might also like to view...

Five modes of operation have been standardized by NIST for use with symmetric block ciphers such as DES and AES: electronic codebook mode, cipher block chaining mode, cipher feedback mode, __________, and counter mode.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Why does a linked list have so many operations to insert an element into the list?

a. The linked list must maintain the links for traversal through the list. b. The linked list must avoid duplicate elements. c. The linked list must perform a search operation when adding an element to the list. d. The linked list must update the head and tail of the list.

Computer Science & Information Technology

Arrange commands are applied only to the items on the currently active layer on the ____ panel.

A. Pages B. Active Layers C. Layers D. Merge

Computer Science & Information Technology

When you use a menu bar, it is at the top of the screen in most GUI programs, and the first menu item is almost always ____.

A. Edit B. File C. Home D. Help

Computer Science & Information Technology