The printf() function generates formatted output, supplying a formatting string with placeholders to output values and variables. It's important to understand how the printf() function works as it's used not only in C but in most computer programming languages.
- [Instructor] It's most likely … that the C language introduced the programming world … to the printf function, … it's immensely popular. … This function generates a formatted output. … Its argument is a format string as shown … in this exercise file, and this text is output. … Unlike the puts function, … a new line isn't added automatically … when this function outputs its text. … So therefore the new line escape character appears … at the end of this string. … Build and run. Hello, world! … The power in the printf function lies … in its formatting string. … Within this string, … you can set placeholders, our conversion characters. … For example, here, you see percent %d, … which is the placeholder for another argument … that must be added, variable a here, … the data types must match. … So %d is for decimal output of an integer value … and variable a is an integer. … Build and run. … The value of a is 65. … In this code, the printf statement … at line nine has three placeholders, …
- 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.