Professional Documents
Culture Documents
Lecture - 17 & 19 Computer Programming: 14 Computer Systems Engineering - Second Semester
Lecture - 17 & 19 Computer Programming: 14 Computer Systems Engineering - Second Semester
Computer Programming
14 Computer Systems Engineering – Second Semester
• Almost all of the programs use some sort of data stored in variables.
• In a program different types of operations are performed on that data.
• The data on which operations are performed are known as operands and the types
of the operations performed are known as operators.
• For Example:
A+B Operator
Operands
Unary Operators
• Perform operation on one operand
Binary Operators
• Perform operation on two operands
Ternary Operators
• Perform operation on three operands
= Assignment Operator
Ali Asghar Manjotho, Lecturer CSE-MUET 9
Assignment Operator in C++
a = a+b
First operand = a
Second operand = b
Result stored back in to first operand i.e. a
== Equals To Binary a == b
a b a && b a b a||b
0 0 0 a !a 0 0 0
0 1 0 0 1 0 1 1
1 0 0 1 0 1 0 1
1 1 1 1 1 1