Logical Operators

This commit is contained in:
2021-04-25 15:46:36 +05:30
parent fe9d80a87e
commit b190456845
3 changed files with 26 additions and 1 deletions

24
LogicalOperator.c Normal file
View File

@@ -0,0 +1,24 @@
// WAP for logical operators.
void main() {
int a = 5, b = 5, c = 10, result;
printf("The Values of a = %d, b = %d \n",a,b);
result = (a == b) && (c > b);
printf("(a == b) && (c > b) is %d \n", result);
result = (a == b) && (c < b);
printf("(a == b) && (c < b) is %d \n", result);
result = (a == b) || (c < b);
printf("(a == b) || (c < b) is %d \n", result);
result = (a != b) || (c < b);
printf("(a != b) || (c < b) is %d \n", result);
result = !(a != b);
printf("!(a != b) is %d \n", result);
result = !(a == b);
printf("!(a == b) is %d \n", result);
}

BIN
LogicalOperator.exe Normal file

Binary file not shown.

View File

@@ -10,3 +10,4 @@
|8 | MaximumNo3.c | MaximumNo3.exe | WAP to find maximum out of three number using conditional operator |
|9 | DataTypeSize.c | DataTypeSize.exe | WAP to check size of following data types: char,int,float, double |
|10 | BitwiseOperators.c | BitwiseOperators.exe | WAP to perform bitwise operators |
|11 | LogicalOperator.c | LogicalOperator.exe | WAP for logical operators |