Consider the following C function.
Palo Alto Networks technical mcq question, verified with a worked answer. Free to practise - no sign-up.
Consider the following C function.
float f(float x, int y)
{
float p, s; int i;
for (s=1, p=1, i=1; i < y; i ++)
{
p*= x/i;
s+=p;
}
return s;
}
For large values of y, the return value of the function f best approximates
Select any one of the following options
Show answer & explanation
Answer: B. A) 1/12th of a second
Covering a 9 ft table at an effective speed of 18 ft/s takes 9 / 18 = 0.5 = 1/2 second.
Step-by-step Derivation:
Step 1: The length of the table to be traversed by the ball is 9 feet.
Step 2: The relative smash speed across the table is 18 feet per second.
Step 3: Time = Distance / Speed = 9 / 18 = 1/2 second.