C/Max.c
2024-05-13 11:09:46 -05:00

26 lines
372 B
C

#include <stdio.h>
#include <stdlib.h>
int main() {
float n1, n2; /* Numbers */
/* Prompt the user */
printf("Enter a number: ");
scanf("%f", &n1);
printf("Enter another number: ");
scanf("%f", &n2);
/* Find and print the maximum number */
if (n1 >= n2)
printf("The maximum is %.2f.\n", n1);
else
printf("The maximum is %.2f.\n", n2);
return 0;
}