An Interest In:
Web News this Week
- March 1, 2024
- February 29, 2024
- February 28, 2024
- February 27, 2024
- February 26, 2024
- February 25, 2024
- February 24, 2024
March 17, 2022 04:45 pm GMT
Original Link: https://dev.to/ilosrim/lesson-02-1kb
Lesson 02
Mathmatical Symbols in C
C is able to perform basic mathematical operations on variables and values using the following symbols:
- Addition:
+
- Subtraction:
-
- Division:
/
- Multiplication:
*
- Incrementing:
++
- Decrementing:
--
- Modulo:
%
Assignment Operations in C
C can assign values to variables and perform basic mathematical operations using shorthand operators:
- Assignment:
=
- Addition then assignment:
+=
- Subtraction then assignment:
-=
- Multiplication then assignment:
*=
- Division then assignment:
/=
- Modulo then assignment:
%=
Comparing values in C
C can compare two values and/or variables against each other to return true or false. The operators are as follows:
- Do both sides have the same value?
==
- Do the two sides have different values?
!=
- Is the left side a lower value than the right side?
<
- Is the left side a lower or equal value to the right side?
<=
- Is the left side a greater value than the right side?
>
- Is the left side a greater or equal value to the right side?
>=
Logical Operators in C
C can perform logical operations using the following operators:
- and:
&&
(Are both sides true?) - or:
||
(Is at least one side true?) - not:
!
(True becomes false and false becomes true.)
Original Link: https://dev.to/ilosrim/lesson-02-1kb
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To