Answer to Question #308213 in C for ahmed

Question #308213

Write a program that print the relation between two integer number if those numbers are equal, not equal and which one contain the higher value.


1
Expert's answer
2022-03-09T01:35:03-0500
#include <stdio.h>

int main()
{
    int a, b;
    printf("First integer: ");
    scanf("%d", &a);
    printf("Second integer: ");
    scanf("%d", &b);
    if (a == b)
        printf("Equal");
    else {
        printf("Not equal; ");
        if (a > b)
            printf("first contains higher value");
        else
            printf("second contains higher value");
    }
    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