proto.c 351 B

12345678910111213141516
  1. /* proto.c -- uses a function prototype */
  2. #include <stdio.h>
  3. int imax(int, int); /* prototype */
  4. int main(void)
  5. {
  6. printf("The maximum of %d and %d is %d.\n",
  7. 3, 5, imax(3));
  8. printf("The maximum of %d and %d is %d.\n",
  9. 3, 5, imax(3.0, 5.0));
  10. return 0;
  11. }
  12. int imax(int n, int m)
  13. {
  14. return (n > m ? n : m);
  15. }