Operators
Learn about arithmetic and logical operators in C.
StartKey Concepts
Review core concepts you need to learn to master this subject
Mathmatical Symbols in C
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:
%
Operators: Lesson
Lesson 1 of 1
- 2At their core, computers are basically fancy calculators. So it’s a good thing to learn how to perform basic mathematical operations early on in your language development. Addition and subtraction…
- 4C has several shorthand tricks you can use to make your life easier. For instance, it is very common inside a loop to have a counter you want to increment (add 1) or decrement (subtract 1) on each …
- 5It’s one thing to do all these operations, but if the results are thrown away as soon as the statement finishes executing, the entire process has limited usability. What we need is a way to assign …
- 6You haven’t learned about statements that check on and respond to true/false (known as boolean) values yet, but since we are talking about arithmetic symbols we wanted to give you a primer with the…
- 7You do not just have to check one part at a time when you are doing your comparisons. C lets you see if two or more parts are true, if at least one is true, or if something is not true. We have alr…
- 8C does not just process the statements you send it blindly from left to right. It looks at the statements and applies standard rules to the order in which the statements should be processed. For in…
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory