 Here's the process of developing a program in C. First, you use an editor to create the source code, which goes into a file that ends with .c. The compiler takes your source code and, if it doesn't have any errors, converts it to an object program with a file that ends in .o. If you have errors in the code, then you have to go back and fix those and compile again. The object file is in a binary format, but it can't be run independently. Instead, the object file is passed on to the linker, which brings in code from C libraries and possibly other programs that are necessary for your program to run. The result of the linking process is an executable file. On Linux and Macintosh systems, this commonly has the name a.out. Depending on your integrated development environment, it might create a file with the .exe extension or it might create a file with your program name and no extension. You can now run this program and see if it gives the desired result. If not, you go back to the edit stage. The compile and link process is often called building the program. Now that we know the process, let's look at a C program, which will save in a file called firstunderscoreprogram.c. Every course and company has its own style guidelines for writing C programs, and so does this course. One of our style guidelines is that we'll always use all lowercase for the file name and use an underscore to separate words in a file name. That means this is a good file name, whereas these file names with capital letters and spaces in the names aren't according to our guidelines. Another one of our guidelines is that every program starts with comments that describe the purpose of a program and that has your name and the date in it. Multi-line comments in C begin with a slash star and end with a star slash. This program demonstrates printing to the console, which is our screen. Its other purpose is to see if the C compiler and linker are installed and working properly. And my name and the date. You may have noticed that the IDE created the leading star on each line. If your integrated development environment doesn't do that, don't worry. As long as you have the beginning slash star and ending star slash, everything is fine. Remember how I said that the linker brings in code from other C libraries? One of the most important libraries is the standard input and output library. You need to tell the compiler that your program is going to use functions from that library, and you do that by including its header file. You say it this way, number sign include, and then in angle brackets the name of the header file, which is STDIO, standing for standard input and output, dot H. Let's save the program now before we lose our hard work. Now it's time for literally the main event. We're going to define a special function named main that has no parameters and returns an integer. We start with the return type int for integer, the name of the function, and then in parentheses the parameters. Because there are no parameters, we use the special keyword void. After this function header, we put a pair of braces. These braces enclose a block, a group of statements that belong together. And here's another style guideline. Our book always puts the opening brace on a line by itself. Some programming guidelines will tell you to put the opening brace at the end of the first line. But we're going to go with the books method for this course. Inside the braces, we'll call the printf function from the standard IO library. We give the name of the function, and then in parentheses we put the argument to that function. And we're going to print out the words, myc program works, exclamation point, and then backslash in. At the end of every c statement, you need to put a semicolon. Printf is the formatted print function. This backslash in is the new line character. If we were to use another printf to print more text, it would then appear on a new line. There are two style guidelines here. First, the last output of your program must end with a new line character. Second, the code inside the braces must be indented. Some integrated development environments indent eight spaces when you press Tab. Others indent only four or two spaces. Some integrated development environments insert actual spaces, and some will merely insert the Tab character. My preference is for four spaces, but this is really a theological issue, and I'm not going to take sides. Use whatever your IDE recommends and be consistent in your usage. We need one more statement inside the main function to complete our program. We said that main returns an integer, and we have to fulfill that contract by typing return zero and again a semicolon to end that statement. This brings up two questions. First, whom are we returning the zero to? And second, why are we returning zero instead of some other number? The zero is being returned to the operating system, which executes your program in the first place. When we return zero, that signals to the operating system that the program completed successfully. A non-zero value would mean some sort of error occurred. Let's save the program and build it, and luckily we had no typing errors, so the compilation finished successfully. When we execute the program, it prints out the message, my C program works, and as you can see, the operating system tells us that exit code was zero. The return code becomes very useful when your operating system lets you write scripts to automate tasks. In a script, you might execute several different C programs as a sequence of steps. The return code will let you know whether one step succeeded or not before you go on to the next step. Let's recap. Your source code gets compiled and linked to become an executable program. Your programs will always begin with comments. The number sign include line gives your program access to all the functions declared in the standard input output header file, stdio.h. The main function is the one that the operating system calls when your program runs. The body of the function is between the braces. The printf function lets you print information to the screen, and you return zero to indicate that the program concluded successfully.