What is the output of the following function call, given the function definition below?

cout << tester (4); // function call

int tester (int n) // function definition
{
if (n == 1)
return 3;
else
return 2 * tester ( n – 1);
}
a) 3
b) 6
c) 12
d) 24


d) 24

Computer Science & Information Technology

You might also like to view...

What does the ScriptEngine function do?

a) It compiles the current script. b) It returns information about the version of VBScript. c) It returns information about the interpreter. d) It returns the type script being used.

Computer Science & Information Technology

Case-Based Critical Thinking QuestionsCase 1: MTN OutdoorYou have just started working for MTN Outdoor as a programmer. Your first assignment is to review and correct various code to use sub procedures and/or functions. Which of the following statements would invoke the GetEndInventory function and assign the function's return value to the intEnd variable?

A. Call GetEndInventory(intBegInv, intItemsSold, intReturned) B. intEnd = Call GetEndInventory(intBegInv, intItemsSold, intReturned) C. intEnd = GetEndInventory(intBegInv, intItemsSold, intReturned) D. intEnd = GetEndInventory()

Computer Science & Information Technology

A(n) ________ is a special environment that allows you to run an operating system on top of another operating system.

A. IDE B. SDLC C. virtual machine D. firewall

Computer Science & Information Technology

Robert is the network administrator for a small business and recently installed a new firewall. After seeing signs of unusually heavy network traffic, he checked his intrusion detection system, which reported that a smurf attack was under way. What firewall configuration change can Robert make to most effectively prevent this attack?

A. Block the source IP address of the attack. B. Block inbound UDP traffic. C. Block the destination IP address of the attack. D. Block inbound ICMP traffic

Computer Science & Information Technology