Can any one help wiht this project? The code is to evaluate two numbers and find the max and min of those numbers using functions. I am new to C proramming and have been stumped on this.
Code:
#include <stdio.h>
#include <stdlib.h>
float maximum(float, float);
float minimum(float, float);
void prn_info (void);
main()
{
//variables
float first_numb = 0.0;
float second_numb = 0.0;
int validate;
//input
printf("Enter First Number: ");
validate =scanf("%f", &first_numb);
if (validate==0)
printf("\nInvalid number\n");
else
printf("\nNumber accepted\n");
printf("Enter Second Number: ");
validate =scanf("%f", &second_numb);
if (validate==0)
printf("\nInvalid number\n");
else
printf("\nNumber accepted\n");
}
float maximum(float first_numb, float second_numb)
float minimum(float first_numb, float second_numb)
{
if
return first_numb < second_numb;
printf("\nThe Maximum number is %f", second_numb);
printf("\nThe Minimum number is %f", first_numb));
else
return first_numb < second_numb;
printf("\nThe Maximum number is %f", first_numb);
printf("\nThe Minimum number is %f", second_numb));
getch();
}
thanks