Tag Archives: C-Operators

Comma Operator in C

Prerequisite – Operators in C The comma operator in C is an operator that allows multiple expressions to be evaluated sequentially in a single statement. Syntax: The syntax of the comma operator is as follows: expr1, expr2, …, exprn; Here, expr1, expr2, …, and exprn are expressions that are evaluated in order from left to right. The value… Read More »

Conditional Operator in C

Prerequisite – Operators in C The conditional operator in C is a ternary operator that is used to evaluate a boolean expression and return one of two values depending on whether the expression is true or false. Syntax: The syntax of the conditional operator is as follows: condition ? value_if_true : value_if_false; Here, condition is a boolean expression… Read More »

Bit-wise Operators in C

Prerequisite – Operators in C In C, bitwise operators are used to perform operations on the binary representation of numbers. These operators can be used to manipulate individual bits in a variable, which can be useful in certain situations such as when working with hardware or networking protocols. Types of Bit-wise Operators in C: There are six bitwise… Read More »

Logical Operators in C

Prerequisite – Operators in C In C, logical operators are used to perform logical operations on expressions that evaluate to either true (nonzero) or false (zero). They are typically used in conditional statements and loops to make decisions based on whether certain conditions are met or not. Types of Logical Operators in C: There are three logical operators… Read More »

Assignment Operators in C

Prerequisite – Operators in C In C, assignment operators are used to assign a value to a variable. They combine the assignment operation (=) with an arithmetic, bitwise, or other operation. Here are the assignment operators in C: List of Assignment Operators in C: Operator Example Equivalent to = a = b a = b += a +=… Read More »

Relational Operators in C

Relational operators in C are used for comparing values and determining whether they are equal, not equal, greater than, less than, greater than or equal to, or less than or equal to each other. Here is a list of relational operators in C: 1. Equal to (==): Returns true if the two operands are equal, false otherwise. In… Read More »

Arithmetic Operators in C

Arithmetic operators in C are used for performing mathematical operations, such as addition, subtraction, multiplication, and division. Here is a list of arithmetic operators in C: 1. Addition (+): Adds two operands together. 2. Subtraction (-): Subtracts one operand from another. 3. Multiplication (*): Multiplies two operands. 4. Division (/): Divides one operand by another. Note that if… Read More »

C Operators

C operators are symbols or keywords that are used to perform different operations on one or more values. In C programming language, operators are classified into several categories, including: 1. Arithmetic Operators: These operators are used to perform basic arithmetic operations such as addition, subtraction, multiplication, division, and modulus (%). Here is a list of all arithmetic operators… Read More »

Operators in C

Operators are the foundation of any programming language. An operator is a symbol or a special character that tells the computer to perform certain mathematical or logical manipulations which is applied to operands to give a result. It can operate on integer and real numbers. For example, consider the below statement: c = a + b; Here, ‘+’… Read More »