write a program to perform logical operator on the given variables in which a= 10 , b= 15 , c= 20 , d = 9
Answers
Answer:
Step-by-step explanation:
// C program to demonstrate working of relational operators
#include <stdio.h>
int main()
{
int a = 10, b = 4;
// greater than example
if (a > b)
printf("a is greater than b\n");
else
printf("a is less than or equal to b\n");
// greater than equal to
if (a >= b)
printf("a is greater than or equal to b\n");
else
printf("a is lesser than b\n");
// less than example
if (a < b)
printf("a is less than b\n");
else
printf("a is greater than or equal to b\n");
// lesser than equal to
if (a <= b)
printf("a is lesser than or equal to b\n");
else
printf("a is greater than b\n");
// equal to
if (a == b)
printf("a is equal to b\n");
else
printf("a and b are not equal\n");
// not equal to
if (a != b)
printf("a is not equal to b\n");
else
printf("a is equal b\n");
return 0;
}