Logical Negation (NOT)

Logical negation (operator !) means a given condition is not fulfilled.

a !a
true false

The operator ! accepts as an argument a bool variable and returns its value.

Video: Logical "NOT"

Watch this video to learn how to use logical "NOT" in programming: https://youtu.be/4U7w2ZSAAW4.

Example: Invalid Number

A given number is valid if it is in the range [100 … 200] or it is 0. Do a validation for an invalid number.

Sample Input and Output

Input Output
75 invalid
150 (no output)
220 invalid

Solution

Testing in the Judge System

Test your solution here: https://judge.softuni.org/Contests/Practice/Index/508#4.

results matching ""

    No results matching ""