Minggu, 05 September 2010

First C program (Hello.c)

You’re probably eager to try your first program in C. To help you become familiar with your compiler, here’s a quick program for you to work through. You might not understand everything at this point, but you should get a feel for the process of writing, compiling, and running a real C program.

This demonstration uses a program named HELLO.C, which does nothing more than display the words Hello, World! on-screen. This program, a traditional introduction to C programming, is a good one for you to learn. The source code for HELLO.C is in Listing 1.1. When you type in this listing, you won’t include the line numbers or co
#include 

 main()
 {
    printf("Hello, World!\n");
     return 0;
 }
Be sure that you have installed your compiler as specified in the installation instructions provided with the software. Whether you are working with UNIX, DOS, or any other operating system, make sure you understand how to use the compiler and editor of your choice. Once your compiler and editor are ready, follow these steps to enter, compile, and execute HELLO.C.

Tidak ada komentar:

Posting Komentar