Logical operator precedence. - C Operator

C examples for Operator:Operator Basics

Description

Logical operator precedence.

Demo Code

#include <stdio.h>

int main( void ){

    int a = 5, b = 6, c = 5, d = 1;
    int x;/*from w  ww .  j  a  va  2  s  .c  o m*/

    x = a < b || a < c && c < d;

    printf("\n%d", x);

    x = (a < b || a < c) && c < d;
    printf("\n%d\n", x);
    return 0;
}

Result


Related Tutorials