C is a programming language, popular computer language today because it is a structured high level, machine independent language. Programmers need not worry about the hardware platform where they will be implemented.

Dennis Ritchie invented C language in 1972, Ken Thompson created a language which was based upon a language known as BCPL and it was called B. B language was created in 1970, basically for UNIX operating system. Dennis Ritchie used ALGOL, BCPL, and B as the basic reference language from which he created C.

C has many qualities which any programmer may desire. It contains the capability of assembly language with the features of high level language which can be used for creating software packages, system software etc.

It supports the programmer with a rich set of built-in functions and operations. C is highly portable. C programs written on one computer can run on other computer without making any changes in the program. Structured programming concept is well supported in C, this helps in dividing the programs into functions (modules) or code blocks.

Sample Program - I

In order to print a message in C programming language we write following code snippets.

#include <stdio.h>
#include <conio.h>
 
void main()
{
/* Printing begins here */
printf ("C is a programming language");
/* Printing ends here */
getch();
}

In the above program, the first line is a preprocessor command which adds the stdio.h header file into our program. Actually stdio.h stands for standard input/output, this header file supports the input-output functions in a program. In a program, we need to provide input data and display processed data on standard output screen. The stdio.h header file supports these two activities. There are many header files which will be discussed in further coming posts.

The second line main() tell the compiler that it is the starting point of the program, every program should essentially have the main function only once in the program. The opening and closing braces indicates the beginning and ending of the program. All the statements between these two braces form the function body. These statements are actually the C code which tells the computer to do something. Each statement is an instruction for the computer to perform specific task.

The /*....*/ is a comment and will not be executed, the compiler simply ignores this statement. These are essential since it enhances the readability and understandability of the program. It is a very good practice to include comments in all the programs to make the users understand what is being done in the program.

The next statement printf(), is the only executable line in the above sample program. The printf() function is a standard inbuilt function for printing a given line which appears inside the double quotes. Therefore in the standard output device we can see the following output.

C is a programming language

The next line is again a comment statement as explained earlier. Then we encounter getch() which holds the output screen until a key is pressed from the keyboard by the user. The closing brace indicates the end of the program.

Executing a C Program

The following basic steps are carried out in executing a C program.
  1. Type the C language program (i.e. source code)
  2. Store the program by giving a suitable name and following it with an extension .c or .C
  3. Compile the program 
  4. Debug the errors if any, that is displayed during compilation
  5. Run the program

Characteristics / Features of C language

Some of C's characteristics that define the language and also have lead to its popularity as a programming language. Naturally we will be studying many of these aspects.
  • Low level (Bitwise) programming readily available
  • Low level feature
  • Portability
  • Powerful
  • Bit manipulation
  • High level features
  • Modular programming
  • Efficient use of pointers
  • More efficient
  • Focuses on procedural programming paradigm
  • 0 (1) performance for all operators


Advantages of C language

  • First of all C language is the basic programming language which is the mother of all modern programming languages.
  • C is the building block for many other currently known languages. For example, Python (fully object oriented high level programming language) is written in C.
  • C is compiled language versus an interpreted language. Simply, this means that the code is compacted into executable instruction. This feature also lends heavily to the speed of C programs.
  • It easily gets compiled without much memory.
  • C is a portable language.
  • It is free form language so, program can be start from any line and column.


Disadvantages of C language

  • There is no runtime checking in C language, as the program extends it is very difficult to fix the bugs.
  • There is no strict type checking (for example, we can pass an integer value for the floating data type).
  • C doesn't have the concept of namespace.
  • C doesn't have the concept of constructors and destructors.
  • It is case sensitive so, mixing case makes difficult while programming.ard to run in the latest operating system (i.e 64-bit system).