Docsity

C Programming Language: Introduction, History, and Fundamentals, Assignments of Programming Languages

Partial preview of the text

Download C Programming Language: Introduction, History, and Fundamentals and more Assignments Programming Languages in PDF only on Docsity!

C Language

• The C programming language 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 originally first implemented on 1972.

Evolution of C

• C began to be used in personal computers for

developing software applications and other purposes.

• C has evolved as it has added some significant

features like memory management, functions, classes

and libraries to its rich feature set.

• C has also influenced the development of numerous

languages such as AMPL, AWK, csh, C++,

C--, C#, Objective-C, Bit C, D, Go, Java, JavaScript,

Julia, Limbo, LPC, Perl, PHP, Pike,

Processing, Python

Evolution of C

• It can be defined by the following ways:

– Mother language

– System programming language

– Procedure-oriented programming language

– Structured programming language

– Mid-level programming language

History of the C Language

• The C programming language was devised in

the early 1970s by Dennis M. Ritchie an

employee from Bell Labs (AT&T).

• In the 1960s Ritchie worked, with several other

employees of Bell Labs (AT&T), on a project

called Multics. The goal of the project was to

develop an operating system for a large

computer that could be used by a thousand

users.

ALGOL

• Algorithmic Language is a family

of imperative computer programming languages,

originally developed in the mid-1950s, which greatly

influenced many other languages and was the standard

method for algorithm.

• The biggest advantage of ALGOL (over preceding

languages such as FORTRAN and COBOL) is that it

encourages the production of well structured programs.

• ALGOL'60 had no official standard input/output

associated with it.

BCPL

  • (^) BCPL (" Basic Combined Programming Language ") is a procedural, imperative, and structured computer programming language.
  • (^) BCPL is no longer in common use.
  • (^) BCPL introduced several features of modern programming languages, including using curly braces to delimit code blocks.
  • (^) The language is unusual in having only one data type.
  • (^) One data type serves as an integer, character, floating-point number or other variable.
  • (^) BCPL by "removing those features of the full language which make compilation difficult“.
  • (^) BCPL has been rumored to have originally stood for "Bootstrap Cambridge Programming Language“.
  • (^) It quickly became popular, largely because of its high portability.
  • (^) the first programming language used to create a MUD.

traditional c

• C is a computer programming language.

• C is an easy language to learn.

• C is called a compiled language.

• This means that once you write your C program,

you must run it through a C compiler to turn your

program into an executable that the computer can

run.

• The C program is the human-readable form.

• C provided the basis for such languages.

Why C Was Developed

  • (^) The B language was a useful one in the context of the challenges the creators of UNIX faced with the operating system.
  • (^) The B language was taken from BCPL by Martin Richards.
  • (^) UNIX was written in assembly language.
  • (^) To perform even small operations in UNIX, one needed to write many pages of code, B solved this problem.
  • (^) B did not recognize data types. Even with B, data types were expressed with machine language. B also did not support data structures.
  • (^) C retained a lot of what B offered, while adding features such as data types and data structures.
  • (^) The name C was chosen because it succeeded B.
  • (^) C was used to perform tasks and operate UNIX.

ANSI

  • (^) 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 only really important difference is the use of function

prototypes.

  • (^) To allow the compiler to check that you are using functions

correctly ANSI C allows you to include a function

prototype which gives the type of the function and the type of

each parameter before you define the function.

  • (^) For example, a prototype for the sum function would be:
  • (^) int sum ( int,int );

ANSI/ISO C

• The ANSI/ISO C Specification Language ( ACSL )

is a specification language for C programs.

• Specifications are written as C annotation

comments to the C program.

• The header files and library facilities that make

up the GNU C Library are a superset of those

specified by the ISO C standard.

Features of C Language

• C is the widely used language. It provides a lot

of features that are given below.

  • (^) Simple
  • (^) Machine Independent or Portable
  • (^) Mid-level programming language
  • (^) structured programming language
  • (^) Memory Management
  • (^) Fast Speed
  • (^) Pointers
  • (^) Recursion
  • (^) Extensible
  • (^) Simple Every c program can be written in simple English language so that it is very easy to understand and developed by programmer.
  • (^) Portability It is the concept of carrying the instruction from one system to another system. In C Language .C file contain source code, we can edit also this code. .exe file contain application, only we can execute this file. When we write and compile any C program on window operating system that program easily run on other window based system.

C Programs

• A C program can vary from 3 lines to millions

of lines and it should be written into one or

more text files with extension ".c"; for

example, hello.c.

• You can use "vi", "vim" or any other text

editor to write your C program into a file.

First C Program

#include <stdio.h>

int main()

printf("Hello ,World!" ");

return 0;