468,497 Members | 1,899 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,497 developers. It's quick & easy.

Integer Variables

10
Given the integer variables x , y , and z , write a fragment of code that assigns the smallest of x , y , and z to another integer variable min .

Assume that all the variables have already been declared and that x , y , and z have been assigned values).
Oct 11 '06 #1
3 9481
Given the integer variables x , y , and z , write a fragment of code that assigns the smallest of x , y , and z to another integer variable min .

Assume that all the variables have already been declared and that x , y , and z have been assigned values).
if ( (x<=y) && (x<=z) ) min = z;
else
if (y <= z) min = y;
else min = z
Oct 11 '06 #2
Jvzj017
10
Thanks ALOT!!
Oct 11 '06 #3
min = x;

if (min > y) min = y;

if (min > z) min = z;
Oct 11 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by cxcodexc | last post: by
3 posts views Thread by Mark McConnell | last post: by
2 posts views Thread by Roger Lord | last post: by
61 posts views Thread by John Baker | last post: by
12 posts views Thread by obdict | last post: by
21 posts views Thread by utab | last post: by
8 posts views Thread by Candace | last post: by
3 posts views Thread by Paul D Ainsworth | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.