Write a function min that has three C string parameters and returns the smallest.
Solution
char* min(char* a, char* b, char* c)
{
return strcmp(a,b) < 0 ? strcmp(a,c) < 0 ? a : c : strcmp(b,c) < 0 ? b : c;
}
Solution
char* min(char* a, char* b, char* c)
{
return strcmp(a,b) < 0 ? strcmp(a,c) < 0 ? a : c : strcmp(b,c) < 0 ? b : c;
}