































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Following points have been discussed in these lecture slides by Baljit Ashvin at Indian Institute of Information Technology (IIIT) under subject of Computer Fundamentals: Program, Programming, Language, IDE, C/C , Introduction, Hello, World, Perform, Specified
Typology: Slides
1 / 39
This page cannot be seen from the preview
Don't miss anything!
































WE ARE SWITCHING TO PROGRAMMING FOR A WHILE
WHAT IS A PROGRAM
A computer program (also software , or just a program ) is a sequence of instructions written to perform a specified task with a computer.
Ref: Stair, Ralph M., et al. (2003). Principles of Information Systems, Sixth Edition
WHAT IS PROGRAMMING LANGUAGE
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer
E.g. add overtime to base pay and store result in gross pay
LOAD BASEPAY
ADD OVERPAY
STORE GROSSPAY
E.g. add overtime to base pay and store result in gross pay grossPay = basePay + overtimePay
WHAT IS C?
In recent years C has been used as a general- purpose language because of its popularity with programmers.
HISTORY OF C
** Typeless – no datatypes. Every data item occupied 1 word in memory.
HISTORY
In 1972 Dennis Ritchie at Bell Labs writes C and in 1978 the publication of The C Programming Language by Kernighan & Ritchie caused a revolution in the computing world
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.
WHY C STILL USEFUL?
C provides: Efficiency, high performance and high quality s/ws flexibility and power many high-level and low-level operations middle level Stability and small size code Provide functionality through rich set of function libraries Gateway for other professional languages like C C++ Java
C is used: System software Compilers, Editors, embedded systems data compression, graphics and computational geometry, utility programs databases, operating systems, device drivers, system level routines there are zillions of lines of C legacy code Also used in application programs
DEVELOPMENT WITH C
Four stages Editing: Writing the source code by using some IDE or editor Preprocessing or libraries: Already available routines compiling: translates or converts source to object code for a specific platform source code -> object code linking: resolves external references and produces the executable module
Portable programs will run on any machine but…..
Note! Program correctness and robustness are most important than program efficiency
C STANDARD LIBRARY
Phase 1^ Editor^ Disk
Program edited in Editor and stored on disk
Phase 2^ Preprocessor^ Disk
Preprocessor program processes the code
Phase 3^ Compiler^ Disk
Creates object code and stores on disk
Phase 4^ Linker^ Disk
Links object code with libraries and stores on disk
BASICS OF C ENVIRONMENT
Phase 5^ Loader
Puts program in memory
Primary memory
Phase 6^ CPU
Takes each instruction and executes it storing new data values
Primary memory