Question: Consider the following functions: Assume x equals 10 and y equals 100. Fill in the following table indicating the number of times each of the
Consider the following functions:

Assume x equals 10 and y equals 100. Fill in the following table indicating the number of times each of the four functions is called in code fragments A–C:

long min (long x, long y) { return x < y ? x = y; } long max(long x, long y) { return x < y ? y: x; } void incr(long *xp, long v) *xp += v; } long square (long x) { return x*x; } A. The following three code fragments call these functions: for (i = min (x, y); i < max (x, y); incr(1, 1)) t+= square (i); B. C. for (i = t max (x, y) square (1); for (i = - long low= min (x, y); long high = max(x, y); 1; i >= min (x, y); incr (&i, -1)). t+= square (1); low; i < high; incr(&i, 1))
Step by Step Solution
3.46 Rating (153 Votes )
There are 3 Steps involved in it
This is a simple exercise but it is important ... View full answer
Get step-by-step solutions from verified subject matter experts
