if (a > c)
swap(a, c);
if (a > b)
swap(a, b);
//Now the smallest element is the 1st one. Just check the 2nd and 3rd
if (b > c)
swap(b, c);
Note: Swap changes the values of two
variables.
More Related Contents:
- "." or "->" C struct accessor [duplicate]
- The most efficient way to implement an integer based power function pow(int, int)
- warning: implicit declaration of function
- What is the difference between char * const and const char *?
- Easy way to use variables of enum types as string in C?
- Dividing 1/n always returns 0.0 [duplicate]
- Dynamic memory access only works inside function
- How does kernel get an executable binary file running under linux?
- C function pointer casting to void pointer
- Using strtok() in nested loops in C?
- __attribute__((constructor)) equivalent in VC?
- Poster with the 8 phases of translation in the C language
- Why didn’t gcc (or glibc) implement _s functions?
- Is the compiler allowed to recycle freed pointer variables?
- C libcurl get output into a string
- FFmpeg C API documentation/tutorial [closed]
- How can I find the number of elements in an array?
- Writing a ‘generic’ struct-print method in C
- C – How to implement Set data structure?
- Which is the best way to get input from user in C?
- socket connect() vs bind()
- Possible to initialize an array after the declaration in C?
- Check if a value from scanf is a number?
- hexadecimal floating constant in C
- What’s a good C decompiler? [closed]
- Flexible array member not getting copied when I make a shallow copy of a struct
- Multiple threads and CPU cache
- Is it safe to use realloc?
- In clang, how do you use per-function optimization attributes?
- Debugging child process after fork (follow-fork-mode child configured)