C Prgram : Explain about Relational Operators?


Explain about Relational Operators?


/* The program explains about Relational Operators */C Prgram : Explain about Relational Operators?

 #include < studio.h >
   main()
     {
       int a, b, c;
       clrscr();
       printf(" Enter two integer values : ");
       scanf(" %d %d", &a, &b);
       printf("Less than : %d < %d is %d \n", a, b, a < b);
       printf("Less than or Equal to : %d <= %d is %d \n", a, b, a <= b);
       printf("Greater than : %d > %d is %d \n", a, b, a > b);
       printf("Less than or Equal to : %d >= %d is %d \n", a, b, a >= b);
       printf("Equal to : %d = %d is %d \n", a, b, a = b);
       printf("Not Equal to : %d != %d is %d \n", a, b, a != b);
       getch();
     }


Input : Enter two integer values : 4 2
Output :
Less than : 4 < 2 is 0
Less than or Equal to : 4 <= 2 is 0
Greater than : 4 > 2 is 1
Greater than or Equal to : 4 >= 2 is 1
Equal to : 4 == 2 is 0
Not Equal to : 4 != 2 is 1

0 Komentar untuk "C Prgram : Explain about Relational Operators?"

Back To Top