PlanetMath (more info)
 Math for the people, by the people.
Encyclopedia | Requests | Forums | Docs | Wiki | Random | RSS  
create new user
forget your password?
Main Menu
C (Definition)

C is a procedural compiled programming language devised by Dennis Ritchie at the Bell Labs in New Jersey in 1972, and standardized in 1983 by ANSI and again by ISO in 1999. The original purpose of C was to write systems software for UNIX, but soon it became the most popular programming language for writing DOS applications, a popularity overshadowed only by the success of using C++ for Windows applications. From the beginning C provided access to certain lower level features of the computer and if that's not enough it also had simpler mechanisms for meshing with assembly language; for that reason C is sometimes compared to dangerous but powerful tools like a chainsaw (Banahan et al, 1991).

The following C program takes two integers as inputs and outputs their greatest common divisor using Euclid's algorithm.

\begin{lstlisting} ...

This program was tested in Visual C++ 6.0, and it works (the appearances of “ $ \backslash\tt {par}$” above should be omitted). The compiler reported 0 errors and 0 warnings, and the program works as it should, at least as long as the inputs are both positive integers. For the pair 42 and $ -21$, it incorrectly reports the GCD as 42. Note that prinft is not a reserved word of the C language, the way that PRINT is in BASIC or ForTran. We can use it because we included the standard I/O library; theoretically, we could write our own printf that tye-dyed the output onto a T-shirt as long as we wrote the appropriate library to take care of it.


M. Banahan, D. Brady & M. Doran, The C book, featuring the ANSI C standard Reading, Mass: Addison-Wesley Publishing (1991)

Anyone with an account can edit this entry. Please help improve it!

"C" is owned by PrimeFan. [ full author list (3) ]
(view preamble)

View style:

Other names:  CPL

Cross-references: onto, FORTRAN, BASIC, word, positive, Euclid's algorithm, greatest common divisor, integers, level, language
There are 5 references to this entry.

This is version 6 of C, born on 2007-03-23, modified 2007-03-24.
Object id is 9107, canonical name is CProgrammingLanguage.
Accessed 198 times total.

AMS MSC68N15 (Computer science :: Software :: Programming languages)

Pending Errata and Addenda
[ View all 2 ]
Style: Expand: Order:
forum policy
C linking policy by PrimeFan on 2007-03-23 17:44:52
Analogous to that for BASIC, such that links for "C" are created only out of AMS MSC 68N15.
[ reply | up ]

rate | post | correct | update request | add derivation | add example | add (any)