Operations In Computer
Operators in Computers: Math, Relational, and Logic
Operators are the symbols that tell the computer what action to perform on data.
In this lesson youβll learn the three core families youβll use everywhere:
- Mathematical operators (e.g.,
+,-,*,/,Mod,^) - Relational operators (e.g.,
=,<,>,<=,>=,<>) - Logical operators (e.g.,
AND,OR,NOT)
Youβll also see truth tables, how computers view True = 1 and False = 0, and realistic decision examples.
1οΈβ£ Operator Types
- Mathematical: arithmetic on numbers
- Relational: compare two values β returns True/False
- Logical: combine/negate conditions (True/False)
2οΈβ£ Mathematical Operators
3οΈβ£ Relational Operators (comparisons return True/False)
4οΈβ£ Logical Operators (work on True/False)
Logic in marriage
Your wife is always right no matter what, and you are always wrong :-)
Logic in computer
5οΈβ£ From Real Life to Computer Logic
The slides illustrate logic with everyday statements (βlogic in marriage/lifeβ) and then map that to computer-style logic with AND / OR / NOT. This helps you see how conditions become code decisions.
Practical AND example (hiring rule):
βYou must meet both conditions to be hired:
- Age β₯ 21 AND Has a driver license.
Computer form:(Age >= 21) AND (HasDriverLicense = True)
A single False in AND β result False (not hired).
Practical OR example (hiring rule):
βYou must meet at least one:
- Age β₯ 21 OR Has a driver license.β
Computer form:(Age >= 21) OR (HasDriverLicense = True)
Any True in OR β result True (hired).
6οΈβ£ AND Operator
7οΈβ£ OR Operator
7οΈβ£ NOT Operator
Practical Example:
I want to hire only Males , so you can say in computer:
- If Male then hire
- or you can use Not: If not (Female) then hire. because not female means male
π Interconnection
- Math operators compute values; Relational compare values; Logical combine decisions.
- Computers evaluate conditions as True/False (i.e., 1/0) and use AND/OR/NOT to decide flow.
- Real policies (like hiring rules) translate directly into logical expressions you can code.
By mastering these, youβll express real-world rules precisely and build reliable decisions in programs. π















12 comments