Not operator is just used to reverse a condition. If the condition is true, it will make it false and vice versa.
#include <stdio.h>
int main()
{
int a = 5, b = 0;
printf("\n%d", !a);
printf("\n%d", !b);
return 0;
}
In this example, the value of b is 0 (false) and so !b will reverse it thus making it 1 (true). Similarly, the value of a is non-zero (true), so !a will make it 0 (false).