Logical Operators Practice
Here's a summary of the primary logical operators:
Symbol | Name | Usage Example | Description |
---|---|---|---|
&& | AND | a && b | a AND b |
|| | OR | a || b | a OR b |
! | NOT | !a | NOT a |
Compito
Swipe to start coding
Choose the appropriate comparison operators to ensure the expression evaluates to true
(logical 1
).
Soluzione
99
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
int main()
{
int x = -6;
bool point = (x > -32 && x < 0);
printf("Is the expression logically correct?\n");
printf("%d\n", point);
return 0;
}
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 3. Capitolo 7
99
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
int main()
{
int x = -6;
bool point = (x ___ -32 && x ___ 0);
printf("Is the expression logically correct?\n");
printf("%d\n", point);
return 0;
}
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione