Home » C programming language

C language - History, Popularity reasons, Characteristics, Basic structure etc

In this tutorial, we are going to learn about C programming language history, popularity reasons, character sticks, basic structure of the programs and some of the drill exercises.
Submitted by Mansha Lamba, on August 23, 2018

Introduction

To get started with any language beginners ought to know about the history of that programming language i.e. One needs to have an insight into the timeline of a programming language like how that language emerged from non-popular language to all-purpose language. In this article, I will give readers a glimpse of the timeline of C language followed by characteristics and the basic structure of the C language program. I will clearly mention What Makes C Language Different & Superior to other languages. This article is not only for C language beginners but it is excellent for people entering programming world.

C language History

  • CPL stands for Common Programming Language. Developed by Martin Richard in the University of Cambridge in the early 1960s.
  • BCPL stands for Basic Combined Programming Language. Extension of CPL. Developed by Martin Richard in the University of Cambridge in 1969. It allows the direct access of memory.
  • B language was developed by Ken Thompson and Dennis Ritchie in 1969.
  • C language was developed by Dennis Ritchie in 1972 at Bell Laboratories in the USA. The main aim of Dennis Ritchie to create C language is to develop a programming language to create a UNIX operating system.

ANSI C

ANSI stands for American National Standard Institute.

After 1972, different companies created their own version of C language so then there was a need to standardize the frame of C language, for this reason, ANSI creates a committee in 1988, the C is the standardize and the name was given to it is ANSI C ( C 89).

After that came, C 90 = C 89 + some new libraries + some keywords as like const, volatile, sign etc, and C 99 = C 90 + some new features.

Reasons behind popularity of C language

  1. Simple, reliable and easy to use.
  2. Portability of compiled code.
  3. Standard library concept ( system defined function, library function).
  4. Ready to access the hardware whenever it is required.
  5. Basic of every programming language like C++ or Java.
  6. Speed is very fast.
  7. Generally, every OS is written in C language and if we want to extend the features of OS, then we need some device drivers and those devices drivers are also written in C language.
  8. Rich in operators. A total number of operators = 45, Total number of Keywords = 32.

Characteristics of C language

  1. General Purpose Programming Language.
  2. Structured Programming Language.
  3. Rich in operators and data types.
  4. Less number of keywords or reserved keywords.
  5. Pointer arithmetic and manipulation.
  6. The user can add their own defined function into the system library.
  7. Compact representation of expression ( combination of variables and constant ).

5 Built-in Data type

  1. Integer ( int )
  2. float
  3. Character ( char )
  4. double
  5. void

Structure of a C program

Basic Structure of a C program is as follows:

    /* Comments */
    Preprocessor Directives
    Global Declaration ;
    main()
    {
	    local declaration ;
	    statements ;
    }

    user-defined functions 

1) Comments

These are optional components of any source code. These statements are used by the developer of the program or by the user, to explain the meaning of statements that are used in the program. These statements are not compiled by the compiler. Generally, comments are of two types:

  1. Single line comment:
     //text 
  2. Multi line comment:
     
        /*  text
            more text 
        */
    

Read more: Comment in C language

2) Preprocessor Directives:
These statements start with #. This statement directs the C preprocessor directive to include header files, to define the constant or to substitute the macros. These are of four types:

  1. #include:
    To include header files
     #include <stdio.h>
  2. #define:
    To declare macros
     #define  PI  3.14
  3. #if:
    Conditional Statements.
  4. #log , #error:
    Miscellaneous

Read more: Preprocessor directives in C

3) Global Declaration

Global variables are those variables whose value can be accessed throughout the complete program or in all functions. The declaration of a global variable is known as a global declaration. Generally, global variables are declared before the main function . The global variable does not declare in any function. These are optional statements.

4) main() function

Every Program must have one main() function. There is only one main function in the complete program. Program execution starts from the main function and also end at the main function. Main Program calls User defined function or system defined function to perform a particular task. Main should be written in the small letter and does not end with a semicolon.

5) Local Declaration

Local declaration statement includes the declaration of a variable and also include initialization of variable in any function. Unlike Global Variables scope of local variables is restricted to the function in which it is defined.

6) Statements

These are statements which are read by compiler and computer then performs the operations that are specified in statements.

7) User-Defined Functions

These are the subprogram. These are defined by the User, according to their needs. These enhance the readability and presentability & reusability of source code. These are an optional part. These function can be added to the system library for future use.

A Simple C program

// standard input output is a header file in C language
# include <stdio.h>

// main function
int  main()
{            
	// printf is an inbuilt 
	// it will display "HEY FOLKS"
	printf("HEY FOLKS\n");     

	return 0;
}

Output

    HEY FOLKS

Now to get started with basic programming in C language I would like readers to try out some Basic drill questions. I highly recommend readers to try out them first themselves and then refer my solutions.

C basic programs





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.