Logical Operators
This commit is contained in:
24
LogicalOperator.c
Normal file
24
LogicalOperator.c
Normal 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
BIN
LogicalOperator.exe
Normal file
Binary file not shown.
@@ -9,4 +9,5 @@
|
||||
|7 | SolveExpressions.c | SolveExpressions.exe | WAP to solve following expressions. r1= (a++) + (a++) & r2= (--a) + (a--).
|
||||
|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 |
|
||||
|10 | BitwiseOperators.c | BitwiseOperators.exe | WAP to perform bitwise operators |
|
||||
|11 | LogicalOperator.c | LogicalOperator.exe | WAP for logical operators |
|
||||
Reference in New Issue
Block a user