Introduction of C

C is a general-purpose, Computer Programming Language. The C programming language was developed by Dennis Ritchie at AT&T Bell Laboratories in the early 1970s.

Introduction

C is a general-purpose, Computer Programming Language. The C programming language was developed by Dennis Ritchie at AT&T Bell Laboratories in the early 1970s. It was not until the late 1970s, however, that this programming language began to gain widespread popularity and support. This was because until that time C compilers were not available for commercial use outside of Bell Laboratories. Unix operating system, which was also developed at Bell Laboratories, had C as its 'standard' programming language.
In fact, well over 90% of the operating system itself was written in the C language! MS-DOS is the most popular environment for the C language.

  • C language is not OOP (Object Oriented Programming) Language.
  • C language is Structure Programming Language.
  • It produces efficient programs.
  • It can handle low-level activities.
  • It can be compiled on a variety of computer platforms.
  • C was invented to write an operating system called UNIX.
  • C is a successor of B language which was introduced around 1970.
  • The UNIX OS was totally written in C by 1973.
  • C is the most widely used and popular System Programming Language.
  • Most of the state-of-the-art software have been implemented using C.
  • Most popular Linux OS and RBDMS MySQL have been written in C.

Compiler for C Language

There are many Compilers available on internet for C-Language like Turbo C++, Borland C++ etc. Download any one and Install.

  • These Tutorials are tested on Borland C++ 5.2.

Comments in C Language


//   is used for Single Line Comment
/*   is used for Multiple Line Comment  */
For Example:
//   This is Single Line Comment.
/*    And This
is Multiple Line
Comment.   */

All the code with beginning two slash // are considered comments and do not effect the program.


C Language Program Structure

#include<stdio.h>
#include<conio.h>
void main()
{
//TODO Code Here!!!
getch();
}

In 'C' programming language all library functions are included in different header files in different categories with .h extension.

  • Header files must be placed at the top of the program. it must be written before program. Sentence that begin with a # are the directives for the preprocessor. this sentence tells compiler to include the header file.
  • stdio stands for 'standard input output'. As it is a header file so .h extension is there. It contains some standard functions related to input and output such as printf and scanf.
  • conio.h is a C header file used mostly by MS-DOS compilers to provide console input/output.
  • void main( ): All executed statements must be written inside the main body because execution starts from main( ). void main( ) is the point from where program begin their execution. In C language all programs have a main function.
  • All statement ends with semicolon.
  • getch( ) function prompts the user to press a character and that character is not printed on screen, getch header file is conio.h.
  • All C programs save with the extension of .cpp.
  • Before compilation process the code is called source program.
  • After compilation process the program is called object program.
  • comments will be ignored.
  • A file which is ready to execute is called Executable file.