Sunday, April 2, 2023

Arithmetic Operators

ARITHMETIC OPERATOR

Arithmetic operators in C are used to perform basic mathematical computations on numeric operands. They allow you to add, subtract, multiply, divide, and perform other arithmetic operations. Here are the arithmetic operators in C:

1. Addition (+): Adds two operands together.

   Example: `int result = 5 + 3; // result is 8`

2. Subtraction (-): Subtracts the second operand from the first operand.

   Example: `int result = 10 - 4; // result is 6`

3. Multiplication (*): Multiplies two operands.

   Example: `int result = 6 * 2; // result is 12`

4. Division (/): Divides the first operand by the second operand. If both operands are integers, integer division is performed (any remainder is discarded).

   Example: `int result = 10 / 3; // result is 3`

5. Modulus (%): Computes the remainder of the division operation between the first operand and the second operand.

   Example: `int result = 10 % 3; // result is 1`


 



BITWISE OPERATOR

  BITWISE OPERATOR In C, bitwise operators are used to perform operations at the bit level of operands. They manipulate individual bits with...