The question isn’t who is going to let me; it’s who is going to stop me.
--Your friends at LectureNotes

C Language

by Mohit KaushikMohit Kaushik
Type: PracticalInstitute: A.I.J.H.M COLLEGE Offline Downloads: 3Views: 390Uploaded: 2 months ago

Share it with your friends

Suggested Materials

Leave your Comments


Mohit Kaushik
Mohit Kaushik
...............Kaushik Institute of Information Technology……….. C – Language & Programs C language is a general purpose and structured programming language developed by 'Dennis Ritchie' at AT &T's Bell Laboratories in the 1972s in USA. It is also called as 'Procedure oriented programming language.' C is not specially designed for specific applications areas like COBOL (Common BusinessOriented Language) or FORTRAN (Formula Translation). It is well suited for business and scietific applications. It has some various features like control structures, looping statements, arrays, macros required for these applications. The C language has following numorous features as:      Portability Flexibility Effectiveness and efficiency Reliability Interactivity EXECUTION OF C PROGRAM : C program executes in following 4 (four steps). 1. Creating a program : An editor like notepad or wordpad is used to create a C program. This file contains a source code which consists of executable code. The file should be saved as '*.c' extension only. 2. Compiling the program : The next step is to compile the program. The code is compiled by using compiler. Compiler converts executable code to binary code i.e. object code. By Mohit Kaushik
...............Kaushik Institute of Information Technology……….. 3. Linking a program to library : The object code of a program is linked with libraries that are needed for execution of a program. The linker is used to link the program with libraries. It creates a file with '*.exe' extension. 4. Execution of program : The final executable file is then run by dos command prompt or by any other software. HISTORY OF C : Year of Establishment 1960 1963 1967 Language Name Developed By ALGOL-60 Cambridge University CPL (Combined Programming Language) Cambridge University BCPL (Basic Combined Martin Richard at Programming Language) Cambridge University 1970 B 1972 C Ken Thompson at AT & T's Bell Laboratories. Dennis Ritchie at AT & T' Bell Laboratory. The development of C was a cause of evolution of programming languages like Algol 60, CPL (Combined Programming Language), BCPL (Basic Combined Programming Language) and B. By Mohit Kaushik
...............Kaushik Institute of Information Technology……….. Algol-60 : (1963) : ALGOL is an acronym for Algorithmic Language. It was the first structured procedural programming language, developed in the late 1950s and once widely used in Europe. But it was too abstract and too general structured language.  CPL : (1963) : CPL is an acronym for Combined Programming Language. It was developed at Cambridge University.  BCPL : (1967) : BCPL is an acronym for Basic Combined Programming Language. It was developed by Martin Richards at Cambridge University in 1967. BCPL was not so powerful. So, it was failed.  B : (1970) : B language was developed by Ken Thompson at AT & T Bell Laboratories in 1970. It was machine dependent. So, it leads to specific problems.  C : (1972) : 'C' Programming Langauage was developed by Dennis Ritchie at AT & T Bell Laboratories in 1972. This is general purpose, compiled, structured programming langauage. Dennis Ritchie studied the BCPL, then improved and named it as 'C' which is the second letter of BCPL STRUCTURE OF C PROGRAM The basic structure of C program is as follow: Document Section Links Section (File) Definition Section Global variable declaration Section void main() By Mohit Kaushik
...............Kaushik Institute of Information Technology……….. { Variable declaration section Function declaration section executable statements; } Function definition 1 ----------------------------------------Function definition n where, Document Section : It consists of set of comment lines which include name of a program, author name, creation date and other information. Links Section (File) : It is used to link the required system libraries or header files to excute a program. Definition Section : It is used to define or set values to variables. Global variable declaration Section : It is used to declare global or public variable. void main() : Used to start of actual C program. It includes two parts as declaration part and executable part. Variable declaration section : Used to declare private variable. Function declaration section : Used to declare functions of program from which we get required output. Then, executable statements are placed for execution. Function definition section : Used to define functions which are to be called from main(). CHARACTER SET : A character refers to the digit, alphabet or special symbol used to data represetation. 1. Alphabets : A-Z, a-z 2. Digits : 0-9 3. Special Characters : ~ ! @ # $ % ^ & * ( ) _ + { } [ ] - < > , . / ? \ | : ; " ' By Mohit Kaushik

Lecture Notes