Write a program in 'C' to enter any two numbers and find and print their maximum.(Using if.....else statement)
#include< #include< #include< main() { float a, b, max; printf("Enter any two numbers\n"); scanf("%f %f", &a, &b); if(a > b) max = a; else max = b; printf("The maximum number is %f\n", max); return(0); } |
---|
For eg :-
Output :-
Enter any two numbers
20.5 32.3
The maximum number is 32.300000
0 comments:
Post a Comment