> Online tutorial : C Programs
Showing posts with label C Programs. Show all posts
Showing posts with label C Programs. Show all posts

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



Click The Menu
A website designed to help you learn C . Understandable C programming tutorials,Videos Tutorials, compiler reviews, source code, tips and tricks.

C Programs

Beginning

  • Simple Hello




  • Add the Two Number




  • Math Function




  • Simple Comments




  • Function Programs




  • Cast Operator




  • Variable Parameters




  • Macro




  • Pointer




  • Pointer




  • Printf Conversion Characters and Types




  • Operators




  • If Programs




  • If and Else Programs




  • Switch Programs






  •