#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
printf ("both are equal\n");
else
printf ("both are not equal\n");
}
Output
#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
values | vlaues | Output |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
printf ("both are equal\n");
else
printf ("both are not equal\n");
}
Output
Enter the value 10 15 Both are not equals |
0 comments:
Post a Comment