Skip to Main Content
Programming in C, Third Edition
book

Programming in C, Third Edition

by Stephen G. Kochan
July 2004
Beginner to intermediate content levelBeginner to intermediate
576 pages
12h 3m
English
Sams
Content preview from Programming in C, Third Edition

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming in C, Fourth Edition

Programming in C, Fourth Edition

Stephen G. Kochan
C Programming Language, 2nd Edition

C Programming Language, 2nd Edition

Brian W. Kernighan, Dennis Ritchie
C How to Program, Fifth Edition

C How to Program, Fifth Edition

P. J. Deitel - Deitel & Associates, Inc., H. M. Deitel - Deitel & Associates, Inc.

Publisher Resources

ISBN: 9780768689068Purchase book