Operators
Arithmetic, comparison, logical, bitwise and assignment operators. ++ and -- change by one.
Example
#include <stdio.h>
int main(void) {
int a = 5;
printf("%d %d %d\n", a++, a, ++a);
printf("%d %d\n", (a > 3) && (a < 10), !a);
a += 3; a <<= 1;
printf("%d\n", a);
return 0;
}Result
6 7 7 1 0 20
Exercise
Logical and.
a b
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.