Home » C program to check two numbers are EQUAL or not without using any operators

C program to check two numbers are EQUAL or not without using any operators

Learn about C program to check two numbers are EQUAL or not without using any operators in the below code example. Also refer the comments in the code snippet to get a detailed view about what’s actually happening.

Contents

C program to check two numbers are EQUAL or not without using any operators

Program:

#include<stdio.h>
int main()
{
   int a, b;
   printf("Enter two numbers:");
   scanf("%d %d",&a, &b);
   if(a^b) printf("Numbers are different.");
   else printf("Both numbers are the same.");
   return 0;
}

Output:

Enter two numbers:4 2
Numbers are different.

Hope above code works for you and Refer the below Related Codes to gain more insights. Happy coding and come back again.

Similar Codes :
Remainder of Two Integer Number Without Using the Modulus Operator in c
Divide Two Integer Number Without Using the Division Operator