C Program Find Maximum of Three Integers Using the Ternary Operator
Here is how you do it
max = ((a>b)?((a>c)?a:c):((b>c)?b:c));
Here is another way
max = ((a>b)?a:b)>c?((a>b)?a:b):c;
Here is some code to find the max of 4 numbers…
Read full article from C Program Find Maximum of Three Integers Using the Ternary Operator
No comments:
Post a Comment