O'Reilly logo

Programming in C, Third Edition by Stephen G. Kochan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Compiling and Running Your First Program

IN THIS CHAPTER, YOU ARE INTRODUCED to the C language so that you can see what programming in C is all about. What better way to gain an appreciation for this language than by taking a look at an actual program written in C?

To begin with, you’ll choose a rather simple example—a program that displays the phrase “Programming is fun.” in your window. Program 3.1 shows a C program to accomplish this task.

Example 3.1. Writing Your First C Program

#include <stdio.h>

int main (void)
{
     printf ("Programming is fun.\n");

     return 0;
}

In the C programming language, lowercase and uppercase letters are distinct. In addition, in C, it does not matter where on the line you begin typing—you can begin typing your ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required