Re: A quiz...

From: R. Seth Trotman (sfd@ix.netcom.com)
Date: 06/10/96


int return_closest_even_below_value(int value)
{
	int temp;
	temp = value DIV 2;
	temp *= 2;
	return(temp);
}

----------
> From: Hades <tourach@servtech.com>
> To: Circle Mailing List <circle@pvv.unit.no>
> Subject: A quiz...
> Date: Tuesday, June 11, 1996 12:25 AM
> 
> I just came up with this and wanted to see if anyone else could figure
it
> out.
> 
> Without using an if statement or the: x == 5 ? "yes" : "no" format (I
forget
> it's technical name) can you do the following (and in the least amount
of
> code too)
> 
> make a function/command/macro/whatever that will take a number and
reduce it
> down to the next even number (IE if it's 12, it returns/gives 12, if
it's
> 13, it gives/returns 12)
> 
> Remember, no if statements, and in least possible code...
> 
> Doh I just though of anohter solution which would be even easier than
the
> first one I came up with... dunno if it'd work tho will have to test it
out.
> :)
> 
> Hades the master of innane questions and dumb shit at wee hours of the
> morning.



This archive was generated by hypermail 2b30 : 12/18/00 PST