C Programming

Introductoin

The count of persons desiring to learn programming increased in last few years as awareness about computer has gone high with easy access of computers not in offices but in homes also. It is fact that today most of the people who want to learn the computer programming start with C programming. The major reason behind it is the wide spread use of C programming since last 30+ years. The C is mainly used in system programming as the program or software written in C is compact and faster. Additionally, it is portable which makes use of program written in C on any hardware possible i.e. from PC(Personal Computer) to supercomputer.

History of C

The C is widely used programming language. The C and Unix are associated with each other right from beginning. The Unix which was written in C is very popular Operating system, Around 1969, the Unix was developed by the Ken Thompson and Denis Richie in Bell Laboratory, America for the PDP series of machines. The strong features and performance of this system attracted the other people in the laboratory to work on it, but it was not possible as it was written in machine language of the PDP machines.

To solve this portability problem, Denis Richie decided to develop such a language which is portable means the program written in that language runs on any machine having different hardware. At that time the language B was popular which was derived from the language BCPL. Denis Richie developed the today's most popular language C from the language B.

Once C was completely developed, they rewrote the Unix in C. That made it possible to port Unix on any hardware as C is portable. Today Unix is available on PC to supercomputers. The C is always part of Unix on all Unix systems. The C is also available on almost all the operating systems.

Features of C

The main features of C language are as follows.

  • C is portable.
  • C does not contain Input/output statements.
  • C supports bit-wise operators which normally are not supported by higher level languages
  • C is modular language.

C is developed to solved the portability problem of Unix. Hence, Program written in C is always portable. Portable means program written on one hardware work on other hardware without modifications or with minor hardware dependent modifications. The portability is very strong feature of C programming.

normally programs written in higher level languages are interactive. For that purpose, programming languages support 1/0 statements. For example, BASIC language contains an INPUT statement to read the input from the keyboard and a PRINT statement to produce the output on screen. But C does not support such 1/0 statements. For this purpose C uses the library functions like scanf and printf.

The C also supports the bit-wise operators to perform the bit-wise operations like AND, OR, NOT etc. Normally, these operations are not supported by the higher level languages, but are common in machine/assembly languages. Because of these reasons (no I/0 statements and support of bit-wise operations), C is not considered as fully higher level language, but known as middle level language.

The programs in C are written in form of functions. A C program is group of one or more functions. Dividing program into small functions, makes it easy to develop and maintain the programs. Each function is easy to understand as it is small. The method of dividing a program into small functions is called modularity. The modularity is essential part of the structured programming. Hence, C is also example of structural programming.