471,850 Members | 996 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,850 software developers and data experts.

Integer Parameters

10
Write the definition of a function min that has two int parameters and returns the smaller.
Oct 11 '06 #1
2 4751
Write the definition of a function min that has two int parameters and returns the smaller.
Hey, try and do them yourself... How else are you gonna learn?...=)

int min(int a, int b){
if (a<=b) return a;
else return b;
}

Bye, I'm going to sleep...
Oct 11 '06 #2
Expand|Select|Wrap|Line Numbers
  1. int min( int x, int y) {
  2.     return x < y ? x : y;
  3. }
  4.  
Oct 12 '06 #3

Post your reply

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

Similar topics

14 posts views Thread by Bart Samwel | last post: by
1 post views Thread by ypul | last post: by
5 posts views Thread by Řyvind Isaksen | last post: by
21 posts views Thread by utab | last post: by
2 posts views Thread by staeri | last post: by
1 post views Thread by =?Utf-8?B?RG9u?= | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.