Kamis, 06 November 2025

ex0802.c if(first > second)

/* ex0802.c */
#include <stdio.h>

int main()
{
    int first, second;

    printf("Input the first number: ");
    scanf("%d", &first);
    printf("Input the second number: ");
    scanf("%d", &second);
    puts("Evaluating...");

    if(first > second)
    {
        printf("%d is greater than %d\n", first,second);
    }
    if(first < second)
    {
        printf("%d is less than %d\n", first,second);
    }
    if(first == second)
    {
        printf("%d is same as %d\n", first,second);
    }
    return(0);
}

output:
 
Input the first number: 3
Input the second number: 7
Evaluating...
3 is less than 7

Process returned 0 (0x0)   execution time : 5.804 s
Press any key to continue.

Tidak ada komentar:

Posting Komentar