> compare two number without using relational operator in c ~ Online tutorial

compare two number without using relational operator in c

#include<stdio.h>
#include<conio.h>
int main () {
{
int a,b;
printf ( "enter the two values u like to compare\n");
scanf (" %d %d",&a,&b);

if (!(a ^ b))

// ^ is Xor operator.
Xor operator function below


valuesvlauesOutput
000
011
101
110


printf ("both are equal\n");
else
printf ("both are not equal\n");
}

Output
Enter the value
10
15
Both are not equals

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: