C Program to Accept two integers and Check if they are equal

0
C Program

In this C program we are accepting two integers using scanf and comparing both the input integer value and comparing them if they are equal or not using if-else. If the integer value are equal we will receive output Number1 and Number2 are equal. Otherwise the output will say Number1 and Number2 are not equal.



#include

void main()

{

    int int1, int2;
 
    printf("Input the values for Number1 and Number2 : ");

    scanf("%d %d", int1, int2);

    if (int1 == int2)

        printf("Number1 and Number2 are equal\n");

    else

        printf("Number1 and Number2 are not equal\n");
}

Leave a Reply

Your email address will not be published. Required fields are marked *