SlideShare a Scribd company logo
Introduction to C
software is a collection of programs and a program is a collection of instructions given to the
computer. Development of software is a stepwise process. Before developing a software,
number of processes e done. The first step is to understand the user requirements. Problem
analysis arises during the requirement phase of software development. Problem analysis is
done for obtaining the user requirements and to determine the input and output of the
program. '=or solving the problem, an "algorithm" is implemented. Algorithm is a sequence of
steps that gives ethod of solving a problem. This "algoritnm" creates the logic of program. On
the basis of this -algorithm", program code is written. The steps before writing program .code
are as~
User requirements
Problem analysis t
Input and Output t
Designing algorithm
Program coding
Process of program development
� In earlier days, every language was designed for some specific purpose. For
example FORTRAN (Formula Translator) was used for scientific and mathematical
applications, COBOL (Common Business Oriented Language) was used for
business applications. So need ofsuch a language was felt which could withstand
most of the purposes. "Necessity is the mother of invention". From here the first
step towards C was put forward by Dennis Ritchie.
� The C lalfguage was developed in 1970's at Bell laboratories by Dennis Ritchie.
Initially it was designed for programming in the operating system called UNIX.
After the advent of C, the whole UNIX operating system was rewritten using it.
Now almost tlvc entire UNIX operating system and the tools supplied with it
including the C compiler itself are written in C.
� The C language is derived from the B language, which was written by Ken
Thompson at AT&T Bell laboratories. The B language was adopted from a
language called BCPL (Basic Combined Programming Language), which was
developed by Martin Richards at Cambridge University. In 1982 a committee was
formed by ANSI (American National Standards Institute) to standardize thl C
language. Finally in 1989, the standard for C language was introduced known as
ANSI C. Generall~ most of the modern compilers conform to this standard
History Of C
It is a middle level language. It has the simplicity of a high level language as well
as the power of ; low level language. This asp;ct of C makes it suitabl~ for
writing both application' programs and systen programs. Hence it is an
excellent, efficient and general-purpose language for most of the application I
such as mathematical, scientific, business and system software applications.
C is small language, consisting of only 32 English words known as keywords (if,
else, for, break etc.: The power of C is augmen,ted by the library functions
provided with it. Moreover, the langua'ge i extendible since it allows the users
to add their own library functions to the library.
C contains control constructs needed to write a structured program hence it is
considered a structure programming language. It includes structures for
selection (if.. .else, switch), repetition (while, fo do...while) and for loop exit
(break). . .
The programs w~itten in C aile portable i.e. programs written for one type of
computer or operatin system can be runon anothet type of computer or
operating system
Characteristics of C
Structure of a C Program
� Designing is the first step for obtaining solution of a
given problem. The purpose of designing is to represent
the solution for the system. It is really difficult to
design a large system because the complexity system
cannot be represented easily. So various methods have
been evolved for designing
Design Methods
� every system has several hierarchies of components.
The top-level component represents the whole system.
Top-Down design method starts from top-level
component to lowest level (bottom) component. this
design method, the system is divided into some major
components
Top-Down Design
� Bottom-Up design method is the reverse of Top-Down
approach. It starts from the lowest level component to the
highest-level component. It first designs the basic components
and from these basic components the higher-level components
are designed.
Bottom-Up Design
� It is better to divide a large system into modules. In terms of
programming, module is logically a well defined part of
program. Each module is a separate part of the program. It is
easy to modify a program written with modular approach
because changes in one module don't affect other modules of
program. It is also easy to check bugs in the program in
module level programming
Modular Approach
� Before learning any language, it is important to know
about the various types of languages and their features.
It is interesting to know what were the basic
requirements of the programmers and what difficulties
they faced with the existing languages. The
programming languages can be classified into two
types-
� 1. Low level languages
� 2. High level languages
Programming Languages
The languages in this category are the Machine level
language and Assembly language
1 .Machine Level Language
2.Assembly Language
Low Lev"el Languages
� Computers can understand only digital signals, which are in
binary digits i.e. 0 and 1. So the instruction given to the
computer can be only in binary codes. The machine
language consists of instructions that are in binary 0 or 1.
Computers can understand only machine level language.
� Writing a program in machine level language is a difficult
task because it is not easy for programmed to write
instructions in binary code. A machine level language
program is error-prone and its maintenance is very difficult.
Furthermore machine language programs are not portable.
Every computer has its own machine instructions, so the
programs written for one computer are not valid for other
computers
Machine Level Language
� The difficulties faced in machine level language were reduced to some
extent by using a modified form Of machine level language called
assembly language. In assembly language instructions are given in
English like words, such as MOV, ADD, SUB etc. So it is easier to
write and understand assembly programs, Since a computer can
understand only machine level language, hence assembly language
program must be translated into machine language. The translator that
is used for translating is called "assembler"
� Although writing programs in assembly language is a bit easier, but
still the programmer has to know all the low level details related with
the hardware of a computer. In assembly language, data is stored in
computer registers and each computer has different set of registers.
Hence the assembly language program is also not portable. Since the
low level languages are related with the hardware, hence the execution
of a low-level program is faster.
Assembly Language
� High-level languages are designed keeping in mind the features of
portability i.e. these languages are machine independent. These are English
like languages, so it is easy to write and understand the programs of high-
level language. While programming in a high level language, the
programmer is not concerned with the low level details, and so the whole
attention can be paid to the logic of the problem being solved. For
translating a high-level language program into machine language, compiler
or interpreter is used. Every language has its own compiler or interpreter.
Some languages in this category are- FORTRAN,COBOL, BASIC, Pascal
etc.
High-Level Languages
� We know that computers can understand only machine
level language, which is in binary 1 or O. It is difficult to
write and maintain programs in machine level language. So
the need arises for converting the code of high-level and
low-level languages into machine level language and
translators are used for this purpose. These translators are
just computer programs, which accept a program written in
high level or low-level, language and produce an equivalent
machine language program as output. The three types of
translators used are-
� • Assembler
� • Compiler
� • Interpreter'
Translators
� Assembler is used for converting the code of low-level language (assembly
language) into machine level language
� Compilers and interpreters are used to convert the code of high-level
language into machine language. The high level program is known as
source program and the corresponding machine language program is
known as object program. Although both compiles and interpreters perform
the same task but there is a' difference in their working.
� A compiler searches all the errors of program and lists them. If the program
is error free then it converts the code of program into machine code and
then the program can be executed by separate commands. An interpreter
checks the errors of program statement by statement. After checking one
statement, it converts that statement into machine erode and then executes
that statement. This process continues until the last statement of program or
an erroneous statement occurs
Coun….
The steps for the execution of C program are as-
1. Program creation
2. Program compilation
3. Program execution
� The C programs are written in :mostly two
environments, UNIX and MS-DOS.
Environment For C
Ppt 1

More Related Content

What's hot

Unit 1
Unit 1Unit 1
Unit 1
TPLatchoumi
 
Language translator
Language translatorLanguage translator
Language translator
asmakh89
 
Cmp2412 programming principles
Cmp2412 programming principlesCmp2412 programming principles
Cmp2412 programming principles
NIKANOR THOMAS
 
Programming languages and paradigms
Programming languages and paradigmsProgramming languages and paradigms
Programming languages and paradigms
John Paul Hallasgo
 
Programming Fundamental Slide No.1
Programming Fundamental Slide No.1Programming Fundamental Slide No.1
Programming Fundamental Slide No.1
Arslan Hussain
 
Programming languages
Programming languagesProgramming languages
Programming languages
Archana Maharjan
 
Compilers and interpreters
Compilers and interpretersCompilers and interpreters
Compilers and interpretersRAJU KATHI
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
Akhil Kaushik
 
Compiler vs interpreter
Compiler vs interpreterCompiler vs interpreter
Compiler vs interpreter
Paras Patel
 
Computer programming
Computer programmingComputer programming
Computer programming
Vincent Valenzuela
 
Interpreted and compiled language
Interpreted and compiled languageInterpreted and compiled language
Interpreted and compiled language
baabtra.com - No. 1 supplier of quality freshers
 
Logical programming languages and functional programming languages
Logical programming languages and functional programming languagesLogical programming languages and functional programming languages
Logical programming languages and functional programming languages
nahianzarif
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingNSU-Biliran Campus
 
Fundamentals of Programming Chapter 2
Fundamentals of Programming Chapter 2Fundamentals of Programming Chapter 2
Fundamentals of Programming Chapter 2
Mohd Harris Ahmad Jaal
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
Sangheethaa Sukumaran
 

What's hot (20)

Unit 1
Unit 1Unit 1
Unit 1
 
Language translator
Language translatorLanguage translator
Language translator
 
Cmp2412 programming principles
Cmp2412 programming principlesCmp2412 programming principles
Cmp2412 programming principles
 
Programming languages and paradigms
Programming languages and paradigmsProgramming languages and paradigms
Programming languages and paradigms
 
Programming Fundamental Slide No.1
Programming Fundamental Slide No.1Programming Fundamental Slide No.1
Programming Fundamental Slide No.1
 
compiler vs interpreter
compiler vs interpretercompiler vs interpreter
compiler vs interpreter
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Compilers and interpreters
Compilers and interpretersCompilers and interpreters
Compilers and interpreters
 
Computer
ComputerComputer
Computer
 
Algorithms - Introduction to computer programming
Algorithms - Introduction to computer programmingAlgorithms - Introduction to computer programming
Algorithms - Introduction to computer programming
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
 
Compiler vs interpreter
Compiler vs interpreterCompiler vs interpreter
Compiler vs interpreter
 
Computer programming
Computer programmingComputer programming
Computer programming
 
Interpreted and compiled language
Interpreted and compiled languageInterpreted and compiled language
Interpreted and compiled language
 
Logical programming languages and functional programming languages
Logical programming languages and functional programming languagesLogical programming languages and functional programming languages
Logical programming languages and functional programming languages
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
Fundamentals of Programming Chapter 2
Fundamentals of Programming Chapter 2Fundamentals of Programming Chapter 2
Fundamentals of Programming Chapter 2
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
La5 programming
La5  programmingLa5  programming
La5 programming
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 

Similar to Ppt 1

Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12
Sehrish Rafiq
 
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
Muhammad Hammad Waseem
 
CS3251-_PIC
CS3251-_PICCS3251-_PIC
Introduction to C Programming Language.pptx
Introduction to C Programming Language.pptxIntroduction to C Programming Language.pptx
Introduction to C Programming Language.pptx
AnithaTAssistantProf
 
C lecture notes new
C lecture notes newC lecture notes new
C lecture notes new
Kuntal Bhowmick
 
Algorithm and flowchart(1)
Algorithm and flowchart(1)Algorithm and flowchart(1)
Algorithm and flowchart(1)Suneel Dogra
 
Unit i (part2) b.sc
Unit i (part2)   b.scUnit i (part2)   b.sc
Unit i (part2) b.sc
Hepsijeba
 
Program, Programming and Programming Language.pptx
Program, Programming and Programming Language.pptxProgram, Programming and Programming Language.pptx
Program, Programming and Programming Language.pptx
HariharPaudel1
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and development
Ali Raza
 
Computer languages
Computer languagesComputer languages
Computer languages
Prince Arsal
 
Introduction to programming language (basic)
Introduction to programming language (basic)Introduction to programming language (basic)
Introduction to programming language (basic)
nharsh2308
 
Introduction to Computer
Introduction to ComputerIntroduction to Computer
Introduction to Computer
zaheeriqbal41
 
Chapter 2.pptx
Chapter 2.pptxChapter 2.pptx
Chapter 2.pptx
TamiratDejene1
 
1.Overview of Programming.pptx
1.Overview of Programming.pptx1.Overview of Programming.pptx
1.Overview of Programming.pptx
Vishwas459764
 
Computer programming
Computer programmingComputer programming
Computer programmingSuneel Dogra
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
Noel Malle
 
Computer language
Computer languageComputer language
Computer language
WASEEM ARSLAN
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
Subramanyambharathis
 
Compiler design slide share
Compiler design slide shareCompiler design slide share
Compiler design slide share
Sudhaa Ravi
 

Similar to Ppt 1 (20)

Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12
 
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
 
C_NOTES.pdf
C_NOTES.pdfC_NOTES.pdf
C_NOTES.pdf
 
CS3251-_PIC
CS3251-_PICCS3251-_PIC
CS3251-_PIC
 
Introduction to C Programming Language.pptx
Introduction to C Programming Language.pptxIntroduction to C Programming Language.pptx
Introduction to C Programming Language.pptx
 
C lecture notes new
C lecture notes newC lecture notes new
C lecture notes new
 
Algorithm and flowchart(1)
Algorithm and flowchart(1)Algorithm and flowchart(1)
Algorithm and flowchart(1)
 
Unit i (part2) b.sc
Unit i (part2)   b.scUnit i (part2)   b.sc
Unit i (part2) b.sc
 
Program, Programming and Programming Language.pptx
Program, Programming and Programming Language.pptxProgram, Programming and Programming Language.pptx
Program, Programming and Programming Language.pptx
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and development
 
Computer languages
Computer languagesComputer languages
Computer languages
 
Introduction to programming language (basic)
Introduction to programming language (basic)Introduction to programming language (basic)
Introduction to programming language (basic)
 
Introduction to Computer
Introduction to ComputerIntroduction to Computer
Introduction to Computer
 
Chapter 2.pptx
Chapter 2.pptxChapter 2.pptx
Chapter 2.pptx
 
1.Overview of Programming.pptx
1.Overview of Programming.pptx1.Overview of Programming.pptx
1.Overview of Programming.pptx
 
Computer programming
Computer programmingComputer programming
Computer programming
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
Computer language
Computer languageComputer language
Computer language
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
 
Compiler design slide share
Compiler design slide shareCompiler design slide share
Compiler design slide share
 

More from Mohit Saini

Introduction of Basic Excel.pptx
Introduction of Basic Excel.pptxIntroduction of Basic Excel.pptx
Introduction of Basic Excel.pptx
Mohit Saini
 
Steps to join though google classroom
Steps to join though google classroomSteps to join though google classroom
Steps to join though google classroom
Mohit Saini
 
Generation of computer
Generation of computerGeneration of computer
Generation of computer
Mohit Saini
 
Hardware software
Hardware softwareHardware software
Hardware software
Mohit Saini
 
Type of coputer
Type of coputerType of coputer
Type of coputer
Mohit Saini
 
Generation of computer
Generation of computerGeneration of computer
Generation of computer
Mohit Saini
 
Excel work
Excel workExcel work
Excel work
Mohit Saini
 
Android
AndroidAndroid
Android
Mohit Saini
 
Number system
Number systemNumber system
Number system
Mohit Saini
 
Big data lecture notes
Big data lecture notesBig data lecture notes
Big data lecture notes
Mohit Saini
 
Ds
DsDs
rdbms-notes
rdbms-notesrdbms-notes
rdbms-notes
Mohit Saini
 
Computer fundamental
Computer fundamentalComputer fundamental
Computer fundamental
Mohit Saini
 
Assignments 150507052746-lva1-app6891
Assignments 150507052746-lva1-app6891Assignments 150507052746-lva1-app6891
Assignments 150507052746-lva1-app6891
Mohit Saini
 
C programming tutorial
C programming tutorialC programming tutorial
C programming tutorial
Mohit Saini
 

More from Mohit Saini (15)

Introduction of Basic Excel.pptx
Introduction of Basic Excel.pptxIntroduction of Basic Excel.pptx
Introduction of Basic Excel.pptx
 
Steps to join though google classroom
Steps to join though google classroomSteps to join though google classroom
Steps to join though google classroom
 
Generation of computer
Generation of computerGeneration of computer
Generation of computer
 
Hardware software
Hardware softwareHardware software
Hardware software
 
Type of coputer
Type of coputerType of coputer
Type of coputer
 
Generation of computer
Generation of computerGeneration of computer
Generation of computer
 
Excel work
Excel workExcel work
Excel work
 
Android
AndroidAndroid
Android
 
Number system
Number systemNumber system
Number system
 
Big data lecture notes
Big data lecture notesBig data lecture notes
Big data lecture notes
 
Ds
DsDs
Ds
 
rdbms-notes
rdbms-notesrdbms-notes
rdbms-notes
 
Computer fundamental
Computer fundamentalComputer fundamental
Computer fundamental
 
Assignments 150507052746-lva1-app6891
Assignments 150507052746-lva1-app6891Assignments 150507052746-lva1-app6891
Assignments 150507052746-lva1-app6891
 
C programming tutorial
C programming tutorialC programming tutorial
C programming tutorial
 

Recently uploaded

block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
abh.arya
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
MuhammadTufail242431
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
PrashantGoswami42
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
Kamal Acharya
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 

Recently uploaded (20)

block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 

Ppt 1

  • 1. Introduction to C software is a collection of programs and a program is a collection of instructions given to the computer. Development of software is a stepwise process. Before developing a software, number of processes e done. The first step is to understand the user requirements. Problem analysis arises during the requirement phase of software development. Problem analysis is done for obtaining the user requirements and to determine the input and output of the program. '=or solving the problem, an "algorithm" is implemented. Algorithm is a sequence of steps that gives ethod of solving a problem. This "algoritnm" creates the logic of program. On the basis of this -algorithm", program code is written. The steps before writing program .code are as~ User requirements Problem analysis t Input and Output t Designing algorithm Program coding Process of program development
  • 2. � In earlier days, every language was designed for some specific purpose. For example FORTRAN (Formula Translator) was used for scientific and mathematical applications, COBOL (Common Business Oriented Language) was used for business applications. So need ofsuch a language was felt which could withstand most of the purposes. "Necessity is the mother of invention". From here the first step towards C was put forward by Dennis Ritchie. � The C lalfguage was developed in 1970's at Bell laboratories by Dennis Ritchie. Initially it was designed for programming in the operating system called UNIX. After the advent of C, the whole UNIX operating system was rewritten using it. Now almost tlvc entire UNIX operating system and the tools supplied with it including the C compiler itself are written in C. � The C language is derived from the B language, which was written by Ken Thompson at AT&T Bell laboratories. The B language was adopted from a language called BCPL (Basic Combined Programming Language), which was developed by Martin Richards at Cambridge University. In 1982 a committee was formed by ANSI (American National Standards Institute) to standardize thl C language. Finally in 1989, the standard for C language was introduced known as ANSI C. Generall~ most of the modern compilers conform to this standard History Of C
  • 3. It is a middle level language. It has the simplicity of a high level language as well as the power of ; low level language. This asp;ct of C makes it suitabl~ for writing both application' programs and systen programs. Hence it is an excellent, efficient and general-purpose language for most of the application I such as mathematical, scientific, business and system software applications. C is small language, consisting of only 32 English words known as keywords (if, else, for, break etc.: The power of C is augmen,ted by the library functions provided with it. Moreover, the langua'ge i extendible since it allows the users to add their own library functions to the library. C contains control constructs needed to write a structured program hence it is considered a structure programming language. It includes structures for selection (if.. .else, switch), repetition (while, fo do...while) and for loop exit (break). . . The programs w~itten in C aile portable i.e. programs written for one type of computer or operatin system can be runon anothet type of computer or operating system Characteristics of C
  • 4. Structure of a C Program
  • 5. � Designing is the first step for obtaining solution of a given problem. The purpose of designing is to represent the solution for the system. It is really difficult to design a large system because the complexity system cannot be represented easily. So various methods have been evolved for designing Design Methods
  • 6. � every system has several hierarchies of components. The top-level component represents the whole system. Top-Down design method starts from top-level component to lowest level (bottom) component. this design method, the system is divided into some major components Top-Down Design
  • 7. � Bottom-Up design method is the reverse of Top-Down approach. It starts from the lowest level component to the highest-level component. It first designs the basic components and from these basic components the higher-level components are designed. Bottom-Up Design
  • 8. � It is better to divide a large system into modules. In terms of programming, module is logically a well defined part of program. Each module is a separate part of the program. It is easy to modify a program written with modular approach because changes in one module don't affect other modules of program. It is also easy to check bugs in the program in module level programming Modular Approach
  • 9. � Before learning any language, it is important to know about the various types of languages and their features. It is interesting to know what were the basic requirements of the programmers and what difficulties they faced with the existing languages. The programming languages can be classified into two types- � 1. Low level languages � 2. High level languages Programming Languages
  • 10. The languages in this category are the Machine level language and Assembly language 1 .Machine Level Language 2.Assembly Language Low Lev"el Languages
  • 11. � Computers can understand only digital signals, which are in binary digits i.e. 0 and 1. So the instruction given to the computer can be only in binary codes. The machine language consists of instructions that are in binary 0 or 1. Computers can understand only machine level language. � Writing a program in machine level language is a difficult task because it is not easy for programmed to write instructions in binary code. A machine level language program is error-prone and its maintenance is very difficult. Furthermore machine language programs are not portable. Every computer has its own machine instructions, so the programs written for one computer are not valid for other computers Machine Level Language
  • 12. � The difficulties faced in machine level language were reduced to some extent by using a modified form Of machine level language called assembly language. In assembly language instructions are given in English like words, such as MOV, ADD, SUB etc. So it is easier to write and understand assembly programs, Since a computer can understand only machine level language, hence assembly language program must be translated into machine language. The translator that is used for translating is called "assembler" � Although writing programs in assembly language is a bit easier, but still the programmer has to know all the low level details related with the hardware of a computer. In assembly language, data is stored in computer registers and each computer has different set of registers. Hence the assembly language program is also not portable. Since the low level languages are related with the hardware, hence the execution of a low-level program is faster. Assembly Language
  • 13. � High-level languages are designed keeping in mind the features of portability i.e. these languages are machine independent. These are English like languages, so it is easy to write and understand the programs of high- level language. While programming in a high level language, the programmer is not concerned with the low level details, and so the whole attention can be paid to the logic of the problem being solved. For translating a high-level language program into machine language, compiler or interpreter is used. Every language has its own compiler or interpreter. Some languages in this category are- FORTRAN,COBOL, BASIC, Pascal etc. High-Level Languages
  • 14. � We know that computers can understand only machine level language, which is in binary 1 or O. It is difficult to write and maintain programs in machine level language. So the need arises for converting the code of high-level and low-level languages into machine level language and translators are used for this purpose. These translators are just computer programs, which accept a program written in high level or low-level, language and produce an equivalent machine language program as output. The three types of translators used are- � • Assembler � • Compiler � • Interpreter' Translators
  • 15. � Assembler is used for converting the code of low-level language (assembly language) into machine level language � Compilers and interpreters are used to convert the code of high-level language into machine language. The high level program is known as source program and the corresponding machine language program is known as object program. Although both compiles and interpreters perform the same task but there is a' difference in their working. � A compiler searches all the errors of program and lists them. If the program is error free then it converts the code of program into machine code and then the program can be executed by separate commands. An interpreter checks the errors of program statement by statement. After checking one statement, it converts that statement into machine erode and then executes that statement. This process continues until the last statement of program or an erroneous statement occurs Coun….
  • 16. The steps for the execution of C program are as- 1. Program creation 2. Program compilation 3. Program execution � The C programs are written in :mostly two environments, UNIX and MS-DOS. Environment For C