1/17
Flashcards covering C programming language operators including arithmetic, relational, logical, bitwise, assignment, and increment/decrement operators.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Operator
A symbol that is used to perform mathematical or logical manipulations in the program.
Arithmetic Operators
Operators used to perform basic mathematical calculations like addition, subtraction, multiplication, division, and modulus operations in an expression.
Modulo Division Operator (%)
An arithmetic operator that gives the remainder value of a division operation (for example, C=A%B gives remainder value).
Relational Operators
Operators used to compare the value of two variables or operands.
Logical Operators
Operators used to compare two or more relational expressions.
Logical AND Operator (&&)
A logical operator that evaluates to true only if all conditions are true (for example, if c=5 and d=2, then ((c==5) && (d>5)) returns false).
Logical OR Operator (∣∣)
A logical operator that evaluates to true if at least one condition is true (for example, if c=5 and d=2, then ((c==5)∣∣(d>5)) returns true).
Logical NOT Operator (!)
A logical operator that reverses the truth value of an expression (for example, if c=5, then !(c==5) returns false).
Bitwise (or Binary) Operators
Special operators supported in C for manipulation of data at the bit level, used for testing bits and shifting them right to left or left to right.
Binary Complement Operator (∼)
A bitwise operator that yields −(n+1) for a given operand n (for example, if B=2, ∼B gives −3).
Left Shift Operator (≪)
A bitwise operator that shifts bits to the left; left shifting one time is equal to multiplying the value by 2 one time.
Right Shift Operator (≫)
A bitwise operator that shifts bits to the right; right shifting one time is equal to dividing the value by 2 one time.
Assignment Operators
Operators used to assign values for variables in programs.
Increment or Decrement Operators
Operators used to increment or decrement a variable or expression value by 1.
Unary Pre-Increment (++operand)
An operator that first evaluates the incremented value and then assigns it (for example, A=++10 first evaluates 11 and assigns A=11).
Unary Pre-Decrement (−operand)
An operator that first evaluates the decremented value and then assigns it (for example, A=−−10 first evaluates 9 and assigns A=9).
Unary Post-Increment (operand++)
An operator that first assigns the current value and then increments it by 1 (for example, A=10++ first assigns A=10 then increments A by 1).
Unary Post-Decrement (operand−−)
An operator that first assigns the current value and then decrements it by 1 (for example, A=10−− first assigns A=10 then decrements A by 1).