Created
March 6, 2020 18:59
-
-
Save Nashtic/687ce054d2ce877bf24b828a82a69124 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <math.h> | |
#include <stdlib.h> | |
max_of_four(int a, int b, int c, int d){ | |
if(a>b && a>c && a>d){ | |
return a; | |
} | |
else if(b>a && b>c && b>d){ | |
return b; | |
} | |
else if(c>a && c>b && c>d){ | |
return c; | |
} | |
else{ | |
return d; | |
} | |
} | |
int main() { | |
int a, b, c, d; | |
scanf("%d %d %d %d", &a, &b, &c, &d); | |
int ans = max_of_four(a, b, c, d); | |
printf("%d", ans); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment