Example
/* Return x*x*x + y*y + z, where x is the smaller of a and b, y is the larger of a and b, and z is 0 if a<=b, and 1 otherwise. */
static int f(
int a,
int b)
{
int c = 0;
if ( a > b ) {
// swap a and b.
int temp;
temp = a;
a = b;
b = temp;
c = 1
}
return a*a*a + b*b + c;
}
Previous slide
Next slide
Back to first slide
View graphic version