Created
June 26, 2019 10:35
-
-
Save anonur/13ab041bb084bfb12bfd02655ec68fda to your computer and use it in GitHub Desktop.
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> | |
/* function declaration */ | |
int max(int num1, int num2); | |
int main() { | |
/* local vaariable definiton */ | |
int a = 100; | |
int b = 200; | |
int ret; | |
/* calling a function to get the max value */ | |
ret = max(a,b); | |
printf("Max value is : %d\n", ret); | |
return 0; | |
} | |
/* function returning the max between two numbers */ | |
int max(int num1, int num2) { | |
/* local variable declaration */ | |
int result; | |
if(num1 > num2) | |
result = num1; | |
else | |
result = num2; | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment