Answer to Question #288469 in C for Nobody

Question #288469

Make a C program that asks the users to enter two numbers. Then, get the total and DISPLAY "I LOVE MY PARENTS" if the sum is more than or equal to 25, otherwise DISPLAY "I WILL NEVER GIVE UP!". Andshow which number is greater and lower.


1
Expert's answer
2022-01-18T08:37:47-0500
#include <stdio.h>

int main()
{
    int a, b, sum;

    printf("Enter number1: ");
    scanf("%d", &a);
    printf("Enter number2: ");
    scanf("%d", &b);

    sum = a+b;
    if (sum >= 25) {
        printf("I LOVE MY PARENTS\n");
    }
    else {
        printf("I WILL NEVER GIVE UP!\n");
    }

    if (a > b) {
        printf("%d is greater, %d is lower\n", a, b);
    }
    else if (a < b) {
        printf("%d is greater, %d is lower\n", b, a);
    }
    else {
        printf("Entered 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