C LANGUAGE 219212 Programming Languages Ms. Raviporn Yongchaitrakul ID: 47541396 ABSTRACT The C programming language was devised in the early 1970s as a system implementation language for the nascent Unix operating system. It is derived from language BCPL Language Categories(Paradigms): Imperative Procedural C evolved a type structure; created on a tiny machine as a tool to improve a meager programming environment. C has become one of the dominant languages of today. BACKGROUND C developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix OS. C came into being in the years 1969-1973 and the most creative period occurred during 1972. Another spate of changes peaked between 1977 and 1979, when portability of the Unix system was being demonstrated. BACKGROUND Finally, in the middle 1980s, the language was officially standardized by the ANSI X3J11 committee, which made further changes. Until the early 1980s, although compilers existed for a variety of machine architectures and operating systems, the language was almost exclusively associated with Unix; more recently, its use has spread much more widely, and today it is among the languages most commonly used throughout the computer industry. GOALS &PURPOSE What were the goals and purpose of this language? The original purpose for C was for systems programming. The 'C' programming language was originally developed for and implemented on the UNIX operating system, on a DEC PDP-11 by Dennis Ritchie. MAIN FEATURES C is "simple" in that the number of components in the language is small-- If two language features accomplish more-or-less the same thing, C will include only one. C's syntax is terse and the language does not restrict what is "allowed" -- the programmer can pretty much do whatever they want. C's type system and error checks exist only at compile-time. The compiled code runs in a stripped down run-time model with no safety checks for bad type casts, bad array indices, or bad pointers. There is no garbage collector to manage memory. Instead the programmer manages heap memory manually. All this makes C fast but fragile. FEATURE DECLARATION All of the C programming language’s integer types—char, short, int, long, long long and pointers or arrays. There of can be declared as ranged. The valid range for a given integer type is the implementation defined minimum and maximum for that type. Range-min must not be arithmetically greater than range-max for any ranged integer. A ranged integer may be declared with any of the C programming language storage class identifiers type def, extern, static, auto, or register. However, only ranged integers with the auto storage class can be declared as dynamic ranged integers. C LANGUAGE MAKE TO THE FIELD OF COMPUTER LANGUAGES The success of Unix was the most important factor; it made the language available to hundreds of thousands of people. Unix's use of C and its consequent portability to a wide variety of machines was important in the system's success. But the language's invasion of other environments suggests more fundamental merits. Despite some aspects mysterious to the beginner and occasionally even to the adept, C remains a simple and small language, translatable with simple and small compilers. Its types and operations are well-grounded in those provided by real machines, and for people used to how computers work, learning the idioms for generating time and space efficient programs is not difficult. At the same time the language is sufficiently abstracted from machine details that program portability can be achieved. C LANGUAGE MAKE TO THE FIELD OF COMPUTER LANGUAGES Equally important, C and its central library support always remained in touch with a real environment. It was not designed in isolation to prove a point, or to serve as an example, but as a tool to write programs that did useful things; it was always meant to interact with a larger operating system, and was regarded as a tool to build larger tools. Finally, despite the changes that it has undergone since its first published description, which was admittedly informal and incomplete, the actual C language as seen by millions of users using many different compilers has remained remarkably stable and unified compared to those of similarly widespread currency, for example Pascal and Fortran. There are differing dialects of C—most noticeably, those described by the older K&R and the newer Standard C—but on the whole, C has remained freer of proprietary extensions than other languages. Perhaps the most significant extensions are the `far' and `near' pointer qualifications intended to deal with peculiarities of some Intel processors. C LANGUAGE MAKE TO THE FIELD OF COMPUTER LANGUAGES Although C was not originally designed with portability as a prime goal, it succeeded in expressing programs, even including operating systems, on machines ranging from the smallest personal computers through the mightiest supercomputers. C is quirky, flawed, and an enormous success. While accidents of history surely helped, it evidently satisfied a need for a system implementation language efficient enough to displace assembly language, yet sufficiently abstract and fluent to describe algorithms and interactions in a wide variety of environments. USED C TODAY Growth in Usage During the 1980s the use of the C language spread widely, and compilers became available on nearly every machine architecture and operating system. It became popular as a programming tool for personal computers, both for manufacturers of commercial software for machines, and for endusers interested in programming. At the start of the decade, nearly every compiler was based on Johnson's pcc; by 1985 there were many independently-produced compiler products. USED C TODAY C is in many ways the most important of the hundreds of programming languages that have been developed in the world to date. It is by far the most frequently used language for writing system software, (i.e., operating systems, other programming languages and compilers), and it is also widely employed for writing application programs. C remains particularly popular in the world of Unix-like operating systems, and, for example, most of the Linux kernel (i.e., the core of the operating system) is written in C. Moreover, it is one of the most frequently studied languages in computer science classes. EXAMPLE sample program segments how to perform some numerical computations. //Find area of Triangle: #include < stdio.h> void main() { int area,width,length; width = 4; length = 4; area = 1/2 * width * length; printf ( "Area of Triangle width %d, length %d is: %d“,width,length,area ); } EXAMPLE sample program segments how to input and output different kinds of data, such as integers, floating pt, and strings. #include < stdio.h> void main() { int a; float b; string c; scanf("Enter integer %d",&a); scanf("Enter Floating Point %f",&b); scanf("Enter String %s",&c); printf("Integer = %d, Floating Point = %f, String %s",a,b,c); } EXAMPLE sample program segments how to write and invoke a function or procedure. #include < stdio.h> void main() { doubleprint("C Language"); } void doubleprint ( string a )// function { printf("%s %s",a,a); } // the result is C Language C Language REFERENCES http://cm.bell-labs.com/cm/cs/who/dmr/chist.html http://www.mycplus.com/c.asp?ID=1 http://cyberdiem.com/vin/learn.html http://www.engin.umd.umich.edu/CIS/course.des /cis400/c/c.html http://www.coronadoenterprises.com/tutorials/c/c _intro.htm http://www.bellevuelinux.org/c.html