Skip to main content

Introduction to C Programming

C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. C was first implemented on the DEC PDP-11 computer in 1972. The main features of C language include low-level access to memory, simple set of keywords, and clean style, these features make C language suitable for system programming like operating system or compiler development.Many later languages have borrowed syntax/features directly or indirectly from C language. Like syntax of Java, PHP, JavaScript and many other languages is mainly based on C language. C++ is nearly a superset of C language having object oriented features.




Ken Thompson (left) with Dennis Ritchie (right, the inventor of the C programming language)

In 1978, Brian Kernighan and Dennis Ritchie produced the first publicly available description of C, now known as the K&R standard.When C was first written the standard was set by its authors Kernighan and Ritche - hence "K&R C". In 1990, an international ANSI standard for C was established which differs from K & R C in a number of ways. The C standard is ISO/IEC 9899:2011, also known as C11 as the final draft was published in 2011. Before C11, there was C99. The C11 final draft is available here. See this for complete history of C standards.
  • The C programming language is a structure oriented programming language, developed at Bell Laboratories in 1972 by Dennis Ritchie
  • C programming language features were derived from an earlier language called “B” (Basic Combined Programming Language – BCPL)
  • C language was invented for implementing UNIX operating system
  • In 1978, Dennis Ritchie and Brian Kernighan published the first edition “The C Programming Language” and commonly known as K&R C
  • In 1983, the American National Standards Institute (ANSI) established a committee to provide a modern, comprehensive definition of C. The resulting definition, the ANSI standard, or “ANSI C”, was completed late 1988.
C programming language standards:
  • C89/C90 standard – First standardized specification for C language was developed by the American National Standards Institute in 1989. C89 and C90 standards refer to the same programming language.
  • C99 standard – Next revision was published in 1999 that introduced new features like advanced data types and other changes.
  • C11 was officially published on Dec 8 2018 provides unicode support and multi threading
  • C17.As of Oct 2018 C17 is the current standard for C Programming Languages.C17 addresses defects in C11 without introducing new language features.
  • C2x is an informal name for the next (after C17) major C language standard revision. It is not expected to be voted on until 2021
C11 and Embedded C language:
  • C11 standard adds new features to C programming language and library like type generic macros, anonymous structures, improved Unicode support, atomic operations, multi-threading and bounds-checked functions. It also makes some portions of the existing C99 library optional and improves compatibility with C++.
  • Embedded C includes features not available in C like fixed-point arithmetic, named address spaces, and basic I/O hardware addressing.
  • Operating systems, C compiler and all UNIX application programs are written in C language
  • It is also called as procedure oriented programming language. The C language is reliable, simple and easy to use. C has been coded in assembly language.
Features of C programming language:
C language is one of the powerful language. Below are some of the features of C language.
  • Reliability
  • Portability
  • Flexibility
  • Interactivity
  • Modularity
  • Efficiency and Effectiveness
Uses of C programming language:
The C programming language is used for developing system applications that forms a major portion of operating systems such as Windows, UNIX and Linux. Below are some examples of C being used.
  • Database systems
  • Graphics packages
  • Word processors
  • Spreadsheets
  • Operating system development
  • Compilers and Assemblers
  • Network drivers
  • Interpreters
Which level is C language belonging to?
There are 3 levels of programming languages. They are,
  1. Middle Level languages:
    Middle level languages don’t provide all the built-in functions found in high level languages, but provides all building blocks that we need to produce the result we want. Examples: C, C++
  2. High Level languages:
    High level languages provide almost everything that the programmer might need to do as already built into the language. Example: Java, Python
  3. Low Level languages:
    Low level languages provides nothing other than access to the machines basic instruction set. Example: Assembler
C language is a structured language:
Structure oriented language:
  • In this type of language, large programs are divided into small programs called functions
  • Prime focus is on functions and procedures that operate on the data
  • Data moves freely around the systems from one function to another
  • Program structure follows “Top Down Approach”
  • Examples: C, Pascal, ALGOL and Modula-2
Object oriented language:
  • In this type of language, programs are divided into objects
  • Prime focus is in the data that is being operated and not on the functions or procedures
  • Data is hidden and cannot be accessed by external functions
  • Program structure follows “Bottom UP Approach”
  • Examples: C++, JAVA and C# (C sharp)
Non structure oriented language:
  • There is no specific structure for programming this language. Examples: BASIC, COBOL, FORTRAN
Key points to remember in C language:

The C language is a structure oriented programming language developed by Dennis Ritchie.
The C language is belonging to middle level programming language.
C was invented to write an operating system called UNIX.
C is a successor of B language which was introduced around the early 1970s.
The language was formalized in 1988 by the American National Standard Institute (ANSI).
The UNIX OS was totally written in C.
Today C is the most widely used and popular System Programming Language.
Most of the state-of-the-art software have been implemented using C.
Today's most popular Linux OS and RDBMS MySQL have been written in C.
Operating system programs such as Windows, Unix, Linux are written in C language.
C89/C90 and C99 are two standardized editions of C language.
C has been written in assembly language.



Comments

Popular posts from this blog

KTU Mandatory C programs for Laboratory and Solutions

LIST OF LAB EXPERIMENTS 1. Familiarization of Hardware Components of a Computer 2. Familiarization of Linux environment – Programming in C with Linux 3. Familiarization of console I/O and operators in C     i) Display “Hello World”     ii) Read two numbers, add them and display their sum     iii) Read the radius of a circle, calculate its area and display it 4. Evaluate the arithmetic expression ((a -b / c * d + e) * (f +g))   and display its solution. Read the values of the variables from the user through console 5. Read 3 integer values, find the largest among them. 6. Read a Natural Number and check whether the number is prime or not 7. Read a Natural Number and check whether the number is Armstrong or not 8. Read n integers, store them in an array and find their sum and average 9. Read n integers, store them in an array and search for an element in the    array using an algorithm for Linear Search 10.Read n integers, store them in an array and sort the elements in t

PROGRAMMING IN C KTU EST 102 THEORY AND LAB NOTES

PROGRAMMING IN C  KTU  EST 102  THEORY AND LAB   COMMON FOR ALL BRANCHES About Me Syllabus Theory Syllabus Lab Model Question Paper EST 102 Programmin in C University Question Papers  and evaluation scheme   EST 102 Programming in C  Introduction( Lab) Introduction to C programming Linux History and GNU How to create a bootable ubuntu USB stick Installing  Linux Install Linux within  Windows Virtual Box and WSL Linux Basic Features and Architecture Basic Linux Commands Beginning C Programming Compiling C programs using gcc in Linux Debugging C program using gdb Module 1: Basics of computer hardware and software          Module-1 Reading Material Basics of Computer Architecture Hardware and Software System Software and Application Software  Programming Languages ( High level, Low level and Machine Language) and Translators ( Compiler, Interpreter, Assembler) Algorithm, Flowcharts and Pseudo code Program Development Structured Programming Basics of hardware ( video) Know about Motherboar

Arrays in C-single and multi dimensional arrays- list and matrix

An array is a collection of data items, all of the same type, accessed using a common name. A one-dimensional array is like a list(vector); A two dimensional array is like a table(matrix). We can have more dimensions. Always, Contiguous (adjacent) memory locations are used to store array elements in memory. Elements of the array can be randomly accessed since we can calculate the address of each element of the array with the given base address and the size of the data element. Declaring  Single Dimensional Arrays Array variables are declared identically to variables of their data type, except that the variable name is followed by one pair of square [ ] brackets for mentioning dimension of the array.  Dimensions used when declaring arrays in C must be positive integral constants or constant expressions.  In C99, dimensions must still be positive integers, but variables can be used, so long as the variable has a positive value at the time the array is declared. ( Space is allo