 Here's a flowchart for a program that calculates how old a person is in days given their age and years. You may be wondering why we're drawing a flowchart for such a small program. The reason is that we want to be in the habit of writing out a plan before we write the program. Now for the C program. To save some time, I've created a file named template.c that has all the code that I'd have to type for every program. There's something new here on line 11. A single line comment. In addition to the multi-line slash star star slash comments, you can make brief comments by putting two slashes in a row. Everything from there to the end of the line is considered a comment. I'll modify the comments at the start to reflect the purpose of the program. And I'll put in today's date. We're going to need variables for the age and years and the age and days. In C, you must declare a variable before you can use it. When you declare a variable, you must tell what data type the variable will contain. This means that C is a statically typed language. The age and years and age and days will be integers, and we start out with this. Like other languages, when you create a variable in C, it is not automatically initialized to some value like zero. Instead, it contains whatever bits happen to be in memory where the variable resides. This is not a good thing. You will always want to explicitly initialize variables. As in many other programming languages, the equal sign does not mean algebraic equality. Instead, it means assignment. Whatever the right-hand side works out to, goes into the variable on the left-hand side. Similarly, in the next assignment statement, the right-hand side works out to 7,665, and that result goes into the variable on the left-hand side. You can declare and initialize variables at the same time, which is a style that I prefer. Our book sometimes puts multiple declarations on a single line, separated by commas. Don't do this. Always write with one declaration per line. This makes your code easier to read and modify. Here's the code in our IDE. Let's save this as a file named yearsanddays.c, and let's build it and see what happens. We get a warning message. We've assigned a value to the days variable, but we haven't used it anywhere else. When you get a warning light on your car's dashboard, you don't ignore it. You want to get it fixed. The same goes for programs. Don't turn in programs that still have warnings. We can get rid of the warning by using the variable, and that will happen when we print the results to the screen. To do that, we'll use the printf function again, taking advantage of the fact that the f in printf stands for formatted. We'll start off with a string that we want to print. You can think of the percent as introducing a placeholder that will be filled in by some value. The letter i that follows the placeholder is the formatting character that says that the value will be an integer. This formatting string has two placeholders, which means you need to provide two variables to fill them in. We'll be looking at other formatting characters later on. But for now, let's rebuild, and the warning has gone away. When we run the program, we get the desired result. Summing up, variables must be declared with their data type. An equal sign indicates assignment, not algebraic equality. The right-hand side of the assignment is completely evaluated, and the result goes into the variable on the left-hand side. The formatting string used in printf can have placeholders that are introduced by a percent sign. The percent sign is followed by a specifier that tells what type of data will fill in that placeholder. You specify the values that fill in the placeholder after the format string. And that's a brief introduction to using variables in a C program.