Guest User

Untitled

a guest
Sep 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. /* function declaration */
  4. int max(int num1, int num2);
  5.  
  6. int main () {
  7.  
  8. /* local variable definition */
  9. int a = 100;
  10. int b = 200;
  11. int ret;
  12.  
  13. /* calling a function to get max value */
  14. ret = max(a, b);
  15.  
  16. printf( "Max value is : %d\n", ret );
  17.  
  18. return 0;
  19. }
  20.  
  21. /* function returning the max between two numbers */
  22. int max(int num1, int num2) {
  23.  
  24. /* local variable declaration */
  25. int result;
  26.  
  27. if (num1 > num2)
  28. result = num1;
  29. else
  30. result = num2;
  31.  
  32. return result;
  33. }
Add Comment
Please, Sign In to add comment