Answer to Question #130900 in C for Abraham

Question #130900
Obtain two numbers from the keyboard, and determine and display which (if either) is the larger of the two numbers.
1
Expert's answer
2020-08-27T16:01:42-0400
#include <stdio.h>

int main()
{
    long double firNum;
    long double secNum;
    printf("Enter the first number: ");
    scanf("%Lf", &firNum);
    printf("Enter the second number: ");
    scanf("%Lf", &secNum);
    if(firNum > secNum)
        printf("%Lf is the larger number.\n", firNum);
    else if(secNum > firNum)
        printf("%Lf is the larger number.\n", secNum);
    else
        printf("The numbers are equal.\n");
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS