In this video, the instructor shares his solution for declaring variables in the code, initializing them to specific values, and sending the values to standard output.
(upbeat music) - [Instructor] Here is how I wrote my solution. On line 5, I create integer variable a, and I immediately assign it the value 16. On line 6, I create the constant character b, which must be immediately assigned to a character. I chose Z for a constant. This is the only way to construct the assignment. You cannot have a statement later that modifies constant b. Build and run, and here's the results. In this variation, I assigned the value of 16 to variable a and its own statement at line 8. This solution is also acceptable, and I hope you devised something similar. Remember, constants are declared by using the const keyword as shown here at line 6, and they must be assigned a value immediately in the same statement.
- 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.