Hey guys i know this is kind of a newbie question but Ive finished all my code. I just want to know how I can change it so that it only deals with float values. I mean so that my program will return the smaller of the two float values without conversion. any help would be great.
Code:
#include <stdio.h>
int my_min(int, int);
int main(void)
{
int number1, number2;
printf("Enter a pair of integers (q to quit):\n");
while (scanf("%d %d", &number1, &number2) == 2)
{
printf("The lesser of %d and %d is %d.\n",
number1, number2, my_min(number1,number2));
printf("Enter a pair of integers (q to quit):\n");
}
printf("Bye.\n");
return 0;
}
int my_min(int x,int y)
{
int min;
if (x < y)
min = x;
else
min = y;
return min;
}