Write a C-program to print logical operators program using &&, || ,!?

Write a C-program to print logical operators program using &&, || ,!


#include <stdio.h>
                                                                         
int main() {
    int x,y,z,p;
    printf("Enter x,y,z values");
    scanf("%d%d%d",&x,&y,&z);
    p=x>y && x>z;
    printf("\n x>y && x>z is :  %d",p);
    p=x>y || x>z;
    printf("\n x>y || x>z is :  %d",p);
    p=!(x>y || x>z);
    printf("\n !(x>y || x>z) is :  %d",p);
    p=!(x>y && x>z);
    printf("\n !(x>y && x>z) is :  %d",p);
    
    return 0;
}
                                            

Output:

Enter x,y,z values 10 20 30

x>y && x>z is : 0
x>y || x>z is : 0
!(x>y || x>z) is : 1
!(x>y && x>z) is : 1




More Programs


15 . Write a C-program to print logical operators program using &&, || ,!
16 . Write a C-program to print bitwise AND operation
17 . Write a C-program to print bitwise OR operation
18 . Write a C-program to print bitwise CAP operation
19 . Write a C-program to print bitwise NEGATION operation
20 . Write a C-program to print bitwise LEFT SHIFT operation
21 . Write a C-program to print bitwise RIGHT SHIFT operation
22 . Write a C-program to print odd or even number using ternary operator
23 . Write a C-program to print max number using ternary operator
24 . Write a C-program to print ODD or Even Number using if else condition
25 . Write a C-program to print max number using if else condtion