The = assignment operator sets the values for variables to literal values, the values of other variables, values returned from a function, or from any expression. You must assign a value to a variable before the variable is used in the code.
- [Instructor] To assign a value to a variable, … you use an assignment operator. … The single equal sign is the most common. … The variable sits on the left side of the equal sign. … A value or expression sits on the right. … In this simple statement, variable A is assigned … the value 126. … The value assigned a variable can be a literal value … or a constant. … It can be a value returned from a function. … It can be the value of another variable … or any C language expression. … Here, four variables are declared, … one for each data type. … The next four statements assign each variable … its appropriate data type value: character A, … integer two, the floating point value 0.25, … and a really big number, 2.5e6 for the double. … This is expressed in E notation. … Four printf statements output each of the four variables … and their values. … The character types are character, decimal integer, … floating point, floating point. … Build and run. … And you can see how double precision output for variable D …
- 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.