eHow launches Android app: Get the best of eHow on the go.

How To

How to Use C

Contributor
By Jackson Lewis
eHow Contributing Writer
(0 Ratings)
Comprehensive Guide to the C Programming Language
Comprehensive Guide to the C Programming Language
Wikimedia Commons by Prentice Hall

The C programming language was first developed in 1972 by Bell Telephone Laboratories to implement the original version of the Unix operating system. Since its development, C has been used for creating application software for both Windows, Unix and Linux operating systems. Over the past 30 years, C has been one of the most popular programming languages in the world. C has also played a large influence on new programming languages which have emerged over the past two decades to include C++, Java and C# which have all adopted similar programming and naming conventions to C.

Difficulty: Moderate
Instructions

Things You'll Need:

  • C Compiler Text Editor
  1. Step 1

    Download and install a C compiler from The Free Country (see Resources).

  2. Step 2

    Open your text editor and save the file name as HelloWorld.c.

  3. Step 3

    Include the Standard Input/Output preprocessing directive at the start of the file. Preprocessing directives are indicated by the #include statement which causes the preprocessor component of the C compiler to replace this part of the file with the information included in the standard input/output library.
    #include <stdio.h>

  4. Step 4

    Call the function main which is used to start program execution in C. The main function returns an integer value and the void statement indicates that no data type are passed as information to the function.
    int main (void)
    {

  5. Step 5

    Next use the printf function to print the words "Hello World" to the computer console.
    printf("Hello World");
    return 0;
    }

  6. Step 6

    Compile the simple program by typing cl HelloWorld.c. This will create HelloWorld.exe that you can then run by double clicking the file name in your file manager and view the output "Hello World" on your console output.

Subscribe

Post a Comment

Post a Comment

eHow Article: How to Use C

Related Ads

  • Have you done this? Click here to let us know.
I Did This
Get Free Computers Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy.   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.

eHow Computers
eHow_eHow Technology and Electronics