C Introduction

What is C? What is it for?

C is a general purpose high level (compiler language) computer programming language, developed by Dennis Ritchie at Bell Labs in late 1972 and was designed with the sole purpose to run on a PDP-11 with a UNIX operating system.

C is known as programmer’s language, every program we write is limited by the language which is used to write it but in case of C we can program anything from a small programs for personal amusement to new operating system.C is one of a large number of high level languages which can be used for general purpose programming.C is best suited for modern computers and modern programming.

High Levels and Low Levels

Computer programming languages majorly are of two types, that is Low Level Languages and High Level Languages. Low Level languages are further categorized into Machine language and Assembly language. These level depends upon the condition that how closely they interact with the computer. Low level is perhaps the easiest to understand, Low level languages are machine oriented and works most closely to the hardware and require extensive knowledge of computer hardware, its configuration and organization .

Machine Language

Machine Language is the language which directly understood by the computer and not needs any further translation before execution. In Machine Language instruction are given in form of machine code and which is a strings of 1′s (one) and 0’s (zero). When this sequence of codes is sent as input to the computer, it understands the codes and converts it in to electrical signals to perform specific operation.
Machine Language is not an easy to learn. The only advantage is that program run very fast because no further translation is required for the CPU to execute it.

Assembly Language

It is the first level of improvement in the programming language. An assembly language program is a set of human readable short codes that substitute op codes (Operation Codes). A translator program is required to translate or map the Assembly Language to machine language. This translator program is know as ‘Assembler’. Assembly language is much easier to write learn and to debug than machine language.

Lets take look into the below example code where same instruction is coded in machine and assembly language:The instruction means:

add the integers in registers $t1 and $t2 and put the result in register $t0.

Assembly language is machine dependent means program written for one computer might not run in other computers with different hardware configuration.

HIGH LEVEL LANGUAGES

High Level Languages instructions are given in natural English like words, it is much problem oriented irrespective of the type of computer you are using.High level languages not only give as a way to express instructions to computer, they also give a channel of communication among human beings. They are not machine bias instead they give a way to express ideas and a way to solve logical problems.

In High Level Languages you must be well versed with token, keywords, programming syntax and the logic of the problem to solve a specific problem.

To execute a set of instruction on a specific machine that is programmed in High Level Language, it must be translated first to its machine language. This is done by a computer program that is knows as compiler. A Compiler is a program which translate a High level language program to a machine language code which is executable code. By using the appropriate compiler we can execute our High level language programs on any platform.

HLLs Advantages:

  • High level language program are machine independent.
  • High level language are more abstract and easy to learn and not require deep knowledge of computer hardware.

C is know as a high level, compiler language.C language is equipped with full fledged set of features that allow programs to write a program in organized,easy and logical way. This is very important when we are writing lengthy programs because complex problems are only manageable with a clear organization and program structure. C gives a way for creating meaningful variable names and meaningful function names to be used in programs without having loss of efficiency and effectiveness of program, it gives a complete freedom of coding style.It has a set of very flexible control structures for decision making and looping that is excellent for controlling the flow of programs.

C Programming Language characteristics

  • Function or procedure oriented
  • C is much more flexible and free-wheeling.
  • Small Size
  • Loose typing
  • Structured Language
  • Low level or BitWise operation readily available
  • Pointer implementation – extensive use of pointers for memory, array, structures and functions.

C Programming Language Advantages

  • Easy to learn and use
  • It has high-level constructs allow the programmer to organize programs in a clear, easy and logical way.
  • Full fledged set of features we can program anything from a small programs for personal amusement to new operating system.
  • Platform Independent and portable
  • Higher the speed of program execution
  • A lot of libraries are already written in C.

C Programming Language Disadvantages

  • C does not have OOPS feature
  • There is no strict type checking (for example: we can pass an integer value for the floating data type).
  • Poor error detection at runtime
  • C doesn’t have the concept of namespace.
  • C doesn’t have the concept of constructors and destructors.