From the course: C Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Working with relational operators - C Tutorial
From the course: C Essential Training
Working with relational operators
- [Instructor] Relational operators are used in C, to compare two values or expressions. These should be familiar to you. Less than, greater than, less than or equal to, greater than or equal to. And of course is equal to and not equal to, which you might not be familiar with. These two must go in this order with the equal sign coming last. The equal operator is used for comparison. This is why I call this comparison, is equal to and not equal. The single equal sign is the assignment operator, big difference. And finally not equal, the exclamation point in programming reads as not. These operators are often coupled with a keyword, such as, if, while and for. The keyword uses the comparison to alter program flow. The expression evaluates either true or false to control program flow. In this code, the if statement at line nine, compares the value input stored in variable A with a value 10. If this expression…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Working with math operators3m 3s
-
(Locked)
Challenge: Do some math49s
-
(Locked)
Solution: Do some math1m 29s
-
(Locked)
Using assignment operators1m 44s
-
(Locked)
Obeying the order of precedence3m 13s
-
(Locked)
Challenge: Get the order correct54s
-
(Locked)
Solution: Get the order correct1m 11s
-
(Locked)
Working with relational operators3m 39s
-
(Locked)
Using logical operators3m 49s
-
(Locked)
Understanding bitwise operators3m 36s
-
(Locked)
Shifting bits3m 18s
-
(Locked)
Exploring unary operators3m 44s
-
(Locked)
Challenge: Binary math1m 5s
-
(Locked)
Solution: Binary math2m 11s
-
-
-
-