ELEVATE YOUR BUSINESS WITH

Limitless customization options & Elementor compatibility let anyone create a beautiful website with Valiance.

Operators in C

SELECT * FROM `itio_tutorial_master` WHERE `tutorial_menu`='28' AND `tutorial_submenu`='1641' AND `tutorial_status`=1 LIMIT 1

Operators in C

? Operators in C

Operators are symbols that perform operations on variables and values. C has a rich set of operators grouped by functionality � arithmetic, logical, relational, and more.


? 1. Arithmetic Operators


OperatorDescriptionExampleResult
+Additiona + b7
-Subtractiona - b3
*Multiplicationa * b10
/Divisiona / b2
%Modulus (remainder)a % b1


? 2. Relational (Comparison) Operators


OperatorMeaningExample
==Equal toa == b
!=Not equal toa != b
>Greater thana > b
<Less thana < b
>=Greater than or equal toa >= b
<=Less than or equal toa <= b


?? 3. Logical Operators


OperatorMeaningExample
&&Logical ANDa > 0 && b > 0
``
!Logical NOT!(a > b)


? 4. Assignment Operators


OperatorMeaningExample
=Assign valuea = 10
+=Add & assigna += 5
-=Subtract & assigna -= 3
*=Multiply & assigna *= 2
/=Divide & assigna /= 4
%=Modulus & assigna %= 3


? 5. Increment & Decrement


OperatorDescriptionExample
++Increment by 1a++ or ++a
--Decrement by 1a-- or --a


? 6. Bitwise Operators


OperatorDescriptionExample
&ANDa & b
``OR
^XORa ^ b
~NOT~a
<<Left shifta << 1
>>Right shifta >> 1


? 7. Ternary Operator

c

condition ? value_if_true : value_if_false;

Example:

c

int max = (a > b) ? a : b;


? 8. Sizeof Operator

Returns the size (in bytes) of a data type or variable:

c

printf("%d", sizeof(int)); // Usually 4

Disclaimer for AI-Generated Content:
The content provided in these tutorials is generated using artificial intelligence and is intended for educational purposes only.
html
docker
php
kubernetes
golang
mysql