180x Filetype PDF File size 0.63 MB Source: old.amu.ac.in
Unit-I Introduction to C What is a Programming Language? • A Programming Languages is a set of rules that provides a way of telling a computer what operations to perform • A programming language is a set of rules for communicating an algorithm • It provides a linguistic framework for describing computations • A programming language is a tool for developing executable models for a class of problem domains • A programming language is a notational system for describing computation in a machine- readable and a human-readable form Levels of Programming Languages: • Executable Machine Code Ex: Hex code or coding in 0s and 1s • Low-level Programming Languages Ex: Assembly language program, 8085, 8086 programming • High-level Programming Languages Ex: FORTRAN, COBOL, Basic, C, C++, Java, HTML, XML • HTML & XML are the high-level mark-up languages Concepts of Programming Language: • English is a natural language. It has words, symbols and grammatical rules • A programming language also has words, symbols and rules of grammar, called syntax • Each programming language has different set of syntax rules • Different programming languages are designed for different types of programs Types of Programming Languages • First Generation Languages Ex: Machine language, hex code • Second Generation Languages Ex: Assembly languages, 8085, 8086 • Third Generation Languages: Closer to English, program written in source code Ex: Fortran, COBOL, C, C++, Visual Basic • Fourth Generation Languages: used with databases Ex: query languages, report generators, form designers • Fifth Generation Languages Ex: LISP, Scheme, SML, Prolog Evolution of C language: • C evolved from two previous languages, BCPL (Basic Combined Programming Language) and B • BCPL developed in 1967 for writing OSes and compilers. • B was used to create an early versions of UNIX OS at bell Laboratories in 1970 on a DEC PDP-7 computer. • Both BCPL and B were typeless languages: the only data type is machine word History of C language: • The C language developed from B by Dennis Ritchie at Bell Laboratories in 1972. • It was named C for new language (after B) • Initially, C used widely as the development language of the UNIX OS. • Today, almost all new major OS are written in C including Windows • The American National Standards Institute (ANSI) Committee approved C language in 1989, called ANSI C. • Then, the document is referred to as ANSI/ISO 9899:1990. • The second edition of Kernighan and Ritchie, published in 1988, this version called ANSI C, then used in worldwide. • Historically, C programming language evolved from C89/C90/C95, C99 and the latest is C11. Introduction to C: • The programming language C was developed in the early 1970s by Dennis Ritchie at Bell Laboratories • It was named ‘C’ because many of its features were derived from an earlier language called ‘B’ • C was designed for implementing system software, later on widely used for developing portable application software • C was developed by Dennis Ritchie in 1972 that took concepts from ALGOL, BCPL, and B. • For many years, C was mainly used in academic institutions • C was documented and popularized in the book The C Programming Language in 1978 by Kernighan and Ritchie • In 1983, the American National Standards Institute (ANSI) started working on defining the standard for C • This standard was approved in December 1989 and came to known as ANSI C • In 1990, the International Standards Organization (ISO) adopted the ANSI standard Taxonomy of C language Characteristics of C: • C is a robust language • Built-in functions and operators can be used to write complex C programs • C compiler combines the features of assembly language and high-level language • A high level programming language enables the programmer to concentrate on the problem • Not worry about the machine code on which the program would be run • Small size – C has only 32 keywords • Extensive use of function calls • Well suited for structured programming, provides easiness in debugging, testing and maintenance • Loose typing - unlike PASCAL • Structured language • Stable language • Quick language • Facilitates low level (bitwise) programming • Supports pointers to refer computer memory, array, structures, and functions • Core language, learning other computer languages becomes much easier, if you know C • Portable language, C program written for one computer can be run on another computer • Extensible language, it enables the user to add his own functions to the C library • Often treated as second best language, best language depends on the particular task to be performed C is the widely used professional language: • It has high-level constructs • It can handle low-level activities • It produces efficient programs • It can be compiled on a variety of computers Drawback: • it has poor error detection which can make it off putting to the beginner Features of C Language
no reviews yet
Please Login to review.