/* File: min1.c
   A sample program which needs to compute
   minimum values.
*/

#include <stdio.h>
#include "genlib.h"
#include "simpio.h"

main() {
   int height1, height2, weight1, weight2 ;
   int min_height, min_weight ;

   printf("Player 1 height: ") ;
   height1 = GetInteger() ;
   printf("Player 1 weight: ") ;
   weight1 = GetInteger() ;

   printf("Player 2 height: ") ;
   height2 = GetInteger() ;
   printf("Player 2 weight: ") ;
   weight2 = GetInteger() ;

   /* Find minimum height */
   if (height1 < height2) {
      min_height = height1 ;
   } else {
      min_height = height2 ;
   }
   printf("The lesser height is: %d\n", min_height) ;

   /* Find minimum weight */
   if (weight1 < weight2) {
      min_weight = weight1 ;
   } else {
      min_weight = weight2 ;
   }
   printf("The lesser weight is: %d\n", min_weight) ;
}
