Important Notice:

Course Content
Building IoT Applications (Chapter-4) M4-R5.1
About Lesson

Example:

#include <stdio.h>

#include <conio.h>

void main()

{

int a = 5, b = 5, c = 10, result;

result = (a = b) && (c > b);

printf(“(a = b) && (c > b) equals to %d n”, result);

result = (a = b) && (c < b);

printf(“(a = b) && (c < b) equals to %d n”, result);

result = (a = b) || (c < b);

printf(“(a = b) || (c < b) equals to %d n”, result);

result = (a != b) || (c < b);

printf(“(a != b) || (c < b) equals to %d n”, result);

result = !(a != b);

printf(“!(a == b) equals to %d n”, result);

result = !(a == b);

printf(“!(a == b) equals to %d n”, result);

}

 

Output

(a = b) && (c > b) equals to 1

(a = b) && (c < b) equals to 0

(a = b) || (c < b) equals to 1

(a != b) || (c < b) equals to 0

!(a != b) equals to 1

!(a == b) equals to 0

error: Content is protected !!