Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- char max_of3(int a, int b, int c);
- int main()
- {
- int a, b, c, max;
- puts("Enter a, b and c:");
- scanf("%d %d %d", &a, &b, &c);
- max = max_of3(a, b, c);
- printf("Maximum of them: %c\n", max);
- system("pause");
- return 0;
- }
- char max_of3(int fa, int fb, int fc)
- {
- int toReturn;
- if (fa < fb)
- {
- toReturn = fb < fc ? 'c' : 'b';
- }
- else
- {
- toReturn = fa < fc ? 'c' : 'a';
- }
- return toReturn;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement