Relational operators, such as less-than, greater-than, and is-equal-to, compare two variables or a variable and a value in an expression. Use expressions with relational operators to alter program flow, control a loop, or make a decision.
- [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 evaluates true, … meaning that the value of variable A is less than 10. …
- Writing your first C program
- Working the C development cycle
- Adding comments to code for clarity
- C language data types
- Declaring variables
- Making new data types
- Typecasting variables
- Using math, assignment, and logical operators
- Creating for and while loops
- Nesting loops
- Creating functions
- Returning values from functions
- Passing arguments to functions
- Creating recursive functions
Skill Level Intermediate
C: Data Structures, Pointers, and File Systemswith Dan Gookin2h 57m Intermediate
1. The Fundamentals of C
2. Variables and Values
3. Operators and Math
4. Decisions and Loops
Next steps1m 38s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.