Created
April 2, 2025 11:15
-
-
Save bonface221/1d15dd46d79a403affca62724abd1321 to your computer and use it in GitHub Desktop.
Checking the greatest number in C
This file contains hidden or 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> | |
int max(int num1, int num2, int num3) | |
{ | |
if (num1 > num2 && num1 > num3) | |
{ | |
return num1; | |
}; | |
if (num2 > num1 && num2 > num3) | |
{ | |
return num2; | |
}; | |
return num3; | |
} | |
int main() | |
{ | |
printf("Answer: %d\n", max(10, 40, 50)); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment