SlideShare a Scribd company logo
C LANGUAGE
What is language
Akhilesh Maithani (akhimaithani65@gmail.com)
 The method of human communication, either
spoken or written, consisting of the use of words in a
structured and conventional way.
What is programming language
Akhilesh Maithani (akhimaithani65@gmail.com)
 A programming language is a formal
constructed language designed to communicate
instructions to a machine, particularly a computer.
Type of programming languages
Akhilesh Maithani (akhimaithani65@gmail.com)
 There are four type of programming languages
 1- Machine Language
 2- Assembly Language
 3-High Level Language
First Generation - Machine Language (code)
Akhilesh Maithani (akhimaithani65@gmail.com)
Machine language programs were made up of instructions written
in binary code.
 This is the “native” language of the computer.
 Each instruction had two parts: Operation code, Operand
 Operation code (Opcode): The command part of a computer
instruction.
 Operand: The address of a specific location in the computer’s
memory.
 Hardware dependent: Could be performed by only one type of
computer with a particular CPU.
Machine level language
Akhilesh Maithani (akhimaithani65@gmail.com)
 It understands the language of the binary digits, 0 and 1.
 We may write a program in whichever language we want,
but it is finally converted into the language of 0s and 1s
before it gets executed.
 Writing a program in machine language is definitely very
difficult.
 It is not possible to memorize a long string of 0s and 1s for
every instruction that you want to derive executed.
Example
Akhilesh Maithani (akhimaithani65@gmail.com)
Machine Code
Assembly language
Akhilesh Maithani (akhimaithani65@gmail.com)
 Assembly language programs are made up of instructions
written in mnemonics.
 Mnemonics: Uses convenient alphabetic abbreviations to represent
operation codes, and abstract symbols to represent operands.
 Each instruction had two parts: Operation code, Operand
 Hardware dependent.
 Because programs are not written in 1s and 0s, the computer must
first translate the program before it can be executed.
Akhilesh Maithani (akhimaithani65@gmail.com)
An opcode is a single instruction that can be executed by
the CPU.
In assembly language mnemonic form an opcode is a
command such as MOV or ADD or JMP.
 For example
MOV, AL, 34h
 The opcode is the MOV instruction. The other parts are
called the 'operands'.
 Operands are manipulated by the opcode.
 In this example, the operands are the register named AL
and the value 34 hex
Example
Akhilesh Maithani (akhimaithani65@gmail.com)
Assembler
High level language
Akhilesh Maithani (akhimaithani65@gmail.com)
 Use statements that resemble English phrases combined with
mathematical terms needed to express the problem or task being
programmed.
 Transportable: NOT-Hardware dependent.
 Because programs are not written in 1s and 0s, the computer must first
translate the program before it can be executed.
Difference b/w high level and low level language
Akhilesh Maithani (akhimaithani65@gmail.com)
High Level
1. Easily understood by humans
2. Uses English like words
3. Easy to locate and identify errors
4. Must be translated before the
computer can understand it
Low Level
1. Understood by computers
without the need for translation
2. Difficult for humans to read and
understand
3. Take up a lot of space to write
down
4. Its difficult to spot errors in the
code
Translators
Akhilesh Maithani (akhimaithani65@gmail.com)
 All programs must be translated before their instructions can
be executed.
 Computer languages can be grouped according to which
translation process is used to convert the instructions into
binary code:
 Assemblers
 Interpreters
 Compilers
Assembled languages:
Akhilesh Maithani (akhimaithani65@gmail.com)
 Assembler: a program used to translate Assembly language
programs.
 Produces one line of binary code per original program statement.
 The entire program is assembled before the program is sent to the
computer for execution.
Interpreted Languages:
Akhilesh Maithani (akhimaithani65@gmail.com)
 Interpreter: A program used to translate high-level programs.
 Translates one line of the program into binary code at a time:
 An instruction is fetched from the original source code.
 The Interpreter checks the single instruction for errors. (If an error is
found, translation and execution ceases. Otherwise…)
 The instruction is translated into binary code.
 The binary coded instruction is executed.
 The fetch and execute process repeats for the entire program.
Compiled languages
Akhilesh Maithani (akhimaithani65@gmail.com)
 Compiler: a program used to translate high-level programs.
 Translates the entire program into binary code before anything is
sent to the CPU for execution.
 The translation process for a compiled program:
 First, the Compiler checks the entire program for syntax errors in the
original source code.
 Next, it translates all of the instructions into binary code.
• Two versions of the same program exist: the original source code
version, and the binary code version (object code).
 Last, the CPU attempts execution only after the programmer requests that
the program be executed
Error
Akhilesh Maithani (akhimaithani65@gmail.com)
 A software bug is an error, failure, or fault in a
computer program or system that causes it to
produce an incorrect or unexpected result, or to
behave in unintended ways.
Types of error
Akhilesh Maithani (akhimaithani65@gmail.com)
 There are basically three types of errors that you must
contend with when writing computer programs:
 Syntax errors
 Runtime errors
 Logic errors
Syntax Error
Akhilesh Maithani (akhimaithani65@gmail.com)
 Syntax errors represent grammar errors in the use of the
programming language.
Common examples are:
 Misspelled variable and function names
 Missing semicolons
 Improperly matches parentheses, square brackets, and curly
braces
 Incorrect format in selection and loop statements
Runtime error
Akhilesh Maithani (akhimaithani65@gmail.com)
 Runtime errors occur when a program with no syntax
errors asks the computer to do something that the
computer is unable to reliably do.
Common examples are:
 Trying to divide by a variable that contains a value of zero
 Trying to open a file that doesn't exist
 There is no way for the compiler to know about these kinds
of errors when the program is compiled
Logic errors
Akhilesh Maithani (akhimaithani65@gmail.com)
 Logic errors occur when there is a design flaw in your
program. Common examples are:
 Multiplying when you should be dividing
 Adding when you should be subtracting
 Opening and using data from the wrong file
 Displaying the wrong message
Introduction of c language
Akhilesh Maithani (akhimaithani65@gmail.com)
 C is a programming language developed at AT & T’s Bell
Laboratories of USA in 1972.
 It was designed by a man named Dennis Ritchie.
 C is popular because it is reliable, simple and easy to use.
 The origin of C is closely tied to the development of the
Unix operating system, originally implemented in
assembly language on a PDP-7 by Ritchie and Thompson,
incorporating several ideas from colleagues.
Akhilesh Maithani (akhimaithani65@gmail.com)
Algol is an early high-level
computer programming
language devised to carry out
scientific calculations.
BCPL (Basic Combined
Programming Language) is
a procedural, imperative,
and structured computer progra
mming language
Features of C
Akhilesh Maithani (akhimaithani65@gmail.com)
 The most important features of C Language are –
 Portability
 Modularity
 Flexibility
 Speed
 Extensibility
 Case Sensitive
Portability
Akhilesh Maithani (akhimaithani65@gmail.com)
 This feature refers to the use of C Language program on
different platforms without any change of configuration. So
C Languages program is independent of platforms.
Modularity
Akhilesh Maithani (akhimaithani65@gmail.com)
 Modularity is the most important feature of structured
programming language.
 This feature refer to the breakdown of large C Language
into small modules.
 Due to modularity features, complications of a program
occurs in time and debugging of program will become
faster.
Flexibility
Akhilesh Maithani (akhimaithani65@gmail.com)
 This feature refer to the programmer’s involvements and
control on the language.
 There are number of reserve words in C Languages which
help the programmer to take control over of language and
modified the structure of the program.
Speed
Akhilesh Maithani (akhimaithani65@gmail.com)
 As C Language supports the system programming so it is
also called as middle level language. Due to this factor, the
program of C Language is compiled and execute with more
speed as compared to program of other high level language.
Extensibility
Akhilesh Maithani (akhimaithani65@gmail.com)
 In C Language Program, New Feature can be added at any
time by programmer. So, C Language program is
extensible.
Case sensitive
Akhilesh Maithani (akhimaithani65@gmail.com)
 C Language is a case sensitive language that is it can
differentiate the character is either upper case or lower
case. All type words either reserve words or user defined
words are case sensitive.
Steps in learning c
Akhilesh Maithani (akhimaithani65@gmail.com)
Alphabets
Digit Special
Symbols
Constants
Variable
Keywords
Instructions Program
The C character Set
Akhilesh Maithani (akhimaithani65@gmail.com)
 A character denotes any alphabets, digit, or special symbol
used to represent information.
 Valid alphabets numbers and special symbols used in C :-
 Alphabets – A,B,…………………..,Y,Z
a,b,………,y,z.
 Digits – 0,1,2,3,4,5,6,7,8,9
 Special Symbols - ~ ‘ ! @ # % ^ & * ( ) _ + = |  { }
[ ] : ; “ ‘ < > , . / ?
Constant
Akhilesh Maithani (akhimaithani65@gmail.com)
 A constant is an entity that doesn’t change .
 Type of C constant :-
(i) Primary Constant
Integer Constant, Real Constant, Character Constant.
(ii) Secondary Constant
Array, Pointer, Structure, Union, Enum, etc.
Rules for Constructing Integer constant
Akhilesh Maithani (akhimaithani65@gmail.com)
 An integer constant must have at least one digit.
 It must not have a decimal point.
 It can be either positive or negative.
 If no sign precedes an integer constant, it is assumed to be
positive.
 No commas or blank are allowed within an integer
constant.
 The allowable range for integer constants is -32768 to
32767.
Rules for constructing real constant
Akhilesh Maithani (akhimaithani65@gmail.com)
 A real constant must have at least one digit.
 It must have a decimal point.
 It could be either positive or negetive.
 Default sign is positive.
 No commas or blanks are allowed within a real constant.
Rules for constructing character constant
Akhilesh Maithani (akhimaithani65@gmail.com)
 A character constant is a single alphabet, a single digit or a
single special symbol enclosed within singh inverted
commas.
 Both the inverted commas should point to the left . For
example, ’A’ is a valid character constant whereas ‘A’ is not.
 The maximum length of a character constant can be 1
Character.
Variable
Akhilesh Maithani (akhimaithani65@gmail.com)
 A variable is an entity that may change, or an entity that
may vary during program execution. Variables name are
names given to location in the memory. These location can
contain integer, real or character constant.
Rules for constructing variable name
Akhilesh Maithani (akhimaithani65@gmail.com)
 A variable name is any combination of 1 to 31 alphabets,
digits or underscores. Some compiler allow variable name
whose length could be upto 247 characters. Still, it would be
safer to stick to the rule of 31 character. Do not create
unnecessarily long variable names as it adds to your typing
effort.
 The first character in the variable name must be an
alphabet or underscore.
 No commas, or blanks are allowed within avariable name.
 No special symbol other than an underscore can be used in
variable name.
Keywords
Akhilesh Maithani (akhimaithani65@gmail.com)
 Keywords are the words whose meaning has already been
explained to the C compiler.
 The Keywords cannot be used as a variable names.
 There are 32 Keywords available in C which are as follows :-
auto double int struct
break else long switch
case enum register typedef
char extern return union
const float short unsigned
continue for signed void
default goto sizeof volatile
do if static while
Akhilesh Maithani (akhimaithani65@gmail.com)

More Related Content

What's hot

Translators(Compiler, Assembler) and interpreter
Translators(Compiler, Assembler) and interpreterTranslators(Compiler, Assembler) and interpreter
Translators(Compiler, Assembler) and interpreter
baabtra.com - No. 1 supplier of quality freshers
 
System Programming- Unit I
System Programming- Unit ISystem Programming- Unit I
System Programming- Unit I
Saranya1702
 
Introduction to c programming language
Introduction to c programming languageIntroduction to c programming language
Introduction to c programming language
sanjay joshi
 
Basic programming concepts
Basic programming conceptsBasic programming concepts
Basic programming concepts
salmankhan570
 
Compiler Design Unit 1
Compiler Design Unit 1Compiler Design Unit 1
Compiler Design Unit 1
Jena Catherine Bel D
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
NSU-Biliran Campus
 
Event Driven programming(ch1 and ch2).pdf
Event Driven programming(ch1 and ch2).pdfEvent Driven programming(ch1 and ch2).pdf
Event Driven programming(ch1 and ch2).pdf
AliEndris3
 
Linker and Loader Explained
Linker and Loader  ExplainedLinker and Loader  Explained
Linker and Loader Explained
Adarsh Kr Sinha
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
Neeru Mittal
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1
REHAN IJAZ
 
Introduction of c programming
Introduction of c programmingIntroduction of c programming
Introduction of c programming
Tarun Sharma
 
Features of 'c' program
Features of 'c' programFeatures of 'c' program
Features of 'c' program
veer patel
 
Types of Programming Languages
Types of Programming LanguagesTypes of Programming Languages
Types of Programming Languages
Juhi Bhoyar
 
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
C notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit orderC notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit order
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
Malikireddy Bramhananda Reddy
 
Programming languages
Programming languagesProgramming languages
Programming languages
gaurav jain
 
Variables, Data Types, Operator & Expression in c in detail
Variables, Data Types, Operator & Expression in c in detailVariables, Data Types, Operator & Expression in c in detail
Variables, Data Types, Operator & Expression in c in detail
gourav kottawar
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programming
mshellman
 
Basic structure of computers
Basic structure of computersBasic structure of computers
Basic structure of computers
Kumar
 
Structure
StructureStructure
Computer programming concepts
Computer programming conceptsComputer programming concepts
Computer programming concepts
Jasper John Cinatad
 

What's hot (20)

Translators(Compiler, Assembler) and interpreter
Translators(Compiler, Assembler) and interpreterTranslators(Compiler, Assembler) and interpreter
Translators(Compiler, Assembler) and interpreter
 
System Programming- Unit I
System Programming- Unit ISystem Programming- Unit I
System Programming- Unit I
 
Introduction to c programming language
Introduction to c programming languageIntroduction to c programming language
Introduction to c programming language
 
Basic programming concepts
Basic programming conceptsBasic programming concepts
Basic programming concepts
 
Compiler Design Unit 1
Compiler Design Unit 1Compiler Design Unit 1
Compiler Design Unit 1
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
Event Driven programming(ch1 and ch2).pdf
Event Driven programming(ch1 and ch2).pdfEvent Driven programming(ch1 and ch2).pdf
Event Driven programming(ch1 and ch2).pdf
 
Linker and Loader Explained
Linker and Loader  ExplainedLinker and Loader  Explained
Linker and Loader Explained
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1
 
Introduction of c programming
Introduction of c programmingIntroduction of c programming
Introduction of c programming
 
Features of 'c' program
Features of 'c' programFeatures of 'c' program
Features of 'c' program
 
Types of Programming Languages
Types of Programming LanguagesTypes of Programming Languages
Types of Programming Languages
 
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
C notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit orderC notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit order
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Variables, Data Types, Operator & Expression in c in detail
Variables, Data Types, Operator & Expression in c in detailVariables, Data Types, Operator & Expression in c in detail
Variables, Data Types, Operator & Expression in c in detail
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programming
 
Basic structure of computers
Basic structure of computersBasic structure of computers
Basic structure of computers
 
Structure
StructureStructure
Structure
 
Computer programming concepts
Computer programming conceptsComputer programming concepts
Computer programming concepts
 

Viewers also liked

Etlo Charleston
Etlo CharlestonEtlo Charleston
Etlo Charleston
elizkeren
 
Introduction to C Language
Introduction to C LanguageIntroduction to C Language
Introduction to C Language
Tarun Sharma
 
Macul Cell Part1
Macul Cell Part1Macul Cell Part1
Macul Cell Part1
elizkeren
 
Introduction to C Language
Introduction to C LanguageIntroduction to C Language
Introduction to C Language
Kamal Acharya
 
Programming languages of computer
Programming languages of computerProgramming languages of computer
Programming languages of computer
Keval Goyani
 
Inside the celll
Inside the celllInside the celll
Inside the celll
Sakil Ahmed
 
Ill effects of mobile
Ill effects of mobileIll effects of mobile
Ill effects of mobile
surbhi_vijh
 
The impact of smart phones.pptx 4
The impact of smart phones.pptx 4The impact of smart phones.pptx 4
The impact of smart phones.pptx 4
kkoe3
 
Overview of c language
Overview of c languageOverview of c language
Overview of c language
shalini392
 
Back to School Is It Worth It?
Back to School Is It Worth It?Back to School Is It Worth It?
Back to School Is It Worth It?
Empowered Presentations
 
The negative impact caused by smartphones.ppt 11
The negative impact caused by smartphones.ppt 11The negative impact caused by smartphones.ppt 11
The negative impact caused by smartphones.ppt 11
cebilewaikiki
 
A presentation on hazards of cell phones
A presentation on hazards of cell phonesA presentation on hazards of cell phones
A presentation on hazards of cell phones
kalyanikatta
 
C ppt
C pptC ppt
C ppt
jasmeen kr
 
Computer languages 11
Computer languages 11Computer languages 11
Computer languages 11
Muhammad Ramzan
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
JavaTpoint.Com
 
Computer Languages.
Computer Languages.Computer Languages.
Computer Languages.
Aditya Sheoran
 
Effect of using mobile phone
Effect of using mobile phoneEffect of using mobile phone
Effect of using mobile phone
Piyali Goswami
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
Abhishek Dwivedi
 
Smartphones presentation
Smartphones presentationSmartphones presentation
Smartphones presentation
fdla1
 

Viewers also liked (20)

Etlo Charleston
Etlo CharlestonEtlo Charleston
Etlo Charleston
 
Introduction to C Language
Introduction to C LanguageIntroduction to C Language
Introduction to C Language
 
Macul Cell Part1
Macul Cell Part1Macul Cell Part1
Macul Cell Part1
 
Introduction to C Language
Introduction to C LanguageIntroduction to C Language
Introduction to C Language
 
Programming languages of computer
Programming languages of computerProgramming languages of computer
Programming languages of computer
 
Inside the celll
Inside the celllInside the celll
Inside the celll
 
Ill effects of mobile
Ill effects of mobileIll effects of mobile
Ill effects of mobile
 
The impact of smart phones.pptx 4
The impact of smart phones.pptx 4The impact of smart phones.pptx 4
The impact of smart phones.pptx 4
 
Overview of c language
Overview of c languageOverview of c language
Overview of c language
 
Back to School Is It Worth It?
Back to School Is It Worth It?Back to School Is It Worth It?
Back to School Is It Worth It?
 
The negative impact caused by smartphones.ppt 11
The negative impact caused by smartphones.ppt 11The negative impact caused by smartphones.ppt 11
The negative impact caused by smartphones.ppt 11
 
A presentation on hazards of cell phones
A presentation on hazards of cell phonesA presentation on hazards of cell phones
A presentation on hazards of cell phones
 
C ppt
C pptC ppt
C ppt
 
Computer languages 11
Computer languages 11Computer languages 11
Computer languages 11
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
 
Computer Languages.
Computer Languages.Computer Languages.
Computer Languages.
 
Effect of using mobile phone
Effect of using mobile phoneEffect of using mobile phone
Effect of using mobile phone
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
 
Smartphones presentation
Smartphones presentationSmartphones presentation
Smartphones presentation
 

Similar to Introduction of c language

1.Overview of Programming.pptx
1.Overview of Programming.pptx1.Overview of Programming.pptx
1.Overview of Programming.pptx
Vishwas459764
 
Fundamentals of Programming Chapter 2
Fundamentals of Programming Chapter 2Fundamentals of Programming Chapter 2
Fundamentals of Programming Chapter 2
Mohd Harris Ahmad Jaal
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and development
Ali Raza
 
C programming introduction
C programming introductionC programming introduction
C programming introduction
Ducat
 
Lecture1 compilers
Lecture1 compilersLecture1 compilers
Lecture1 compilers
Aftab Ahmad
 
Introduction to Computer
Introduction to ComputerIntroduction to Computer
Introduction to Computer
zaheeriqbal41
 
Ppt 1
Ppt 1Ppt 1
Introduction to programming c
Introduction to programming cIntroduction to programming c
Introduction to programming c
Md. Rakibuzzaman Khan Pathan
 
Computer program, computer languages, computer software
Computer program, computer languages, computer softwareComputer program, computer languages, computer software
Computer program, computer languages, computer software
Sweta Kumari Barnwal
 
Introduct To C Language Programming
Introduct To C Language ProgrammingIntroduct To C Language Programming
Introduct To C Language Programming
yarkhosh
 
Introduction to Computer Programming (general background)
Introduction to Computer Programming (general background)Introduction to Computer Programming (general background)
Introduction to Computer Programming (general background)
Chao-Lung Yang
 
Introduction_to_Programming.pptx
Introduction_to_Programming.pptxIntroduction_to_Programming.pptx
Introduction_to_Programming.pptx
PmarkNorcio
 
Introduction to programming language (basic)
Introduction to programming language (basic)Introduction to programming language (basic)
Introduction to programming language (basic)
nharsh2308
 
CS3251-_PIC
CS3251-_PICCS3251-_PIC
Computer programming
Computer programmingComputer programming
Computer programming
Mohamed Asarudeen
 
Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12
Sehrish Rafiq
 
Programming in C
Programming in CProgramming in C
Programming in C
Rvishnupriya2
 
Programming in c
Programming in cProgramming in c
Programming in c
vishnu973656
 
Unit 1
Unit 1Unit 1
Unit 1
TPLatchoumi
 
Software Concepts Notes
Software Concepts NotesSoftware Concepts Notes
Software Concepts Notes
Prof. Dr. K. Adisesha
 

Similar to Introduction of c language (20)

1.Overview of Programming.pptx
1.Overview of Programming.pptx1.Overview of Programming.pptx
1.Overview of Programming.pptx
 
Fundamentals of Programming Chapter 2
Fundamentals of Programming Chapter 2Fundamentals of Programming Chapter 2
Fundamentals of Programming Chapter 2
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and development
 
C programming introduction
C programming introductionC programming introduction
C programming introduction
 
Lecture1 compilers
Lecture1 compilersLecture1 compilers
Lecture1 compilers
 
Introduction to Computer
Introduction to ComputerIntroduction to Computer
Introduction to Computer
 
Ppt 1
Ppt 1Ppt 1
Ppt 1
 
Introduction to programming c
Introduction to programming cIntroduction to programming c
Introduction to programming c
 
Computer program, computer languages, computer software
Computer program, computer languages, computer softwareComputer program, computer languages, computer software
Computer program, computer languages, computer software
 
Introduct To C Language Programming
Introduct To C Language ProgrammingIntroduct To C Language Programming
Introduct To C Language Programming
 
Introduction to Computer Programming (general background)
Introduction to Computer Programming (general background)Introduction to Computer Programming (general background)
Introduction to Computer Programming (general background)
 
Introduction_to_Programming.pptx
Introduction_to_Programming.pptxIntroduction_to_Programming.pptx
Introduction_to_Programming.pptx
 
Introduction to programming language (basic)
Introduction to programming language (basic)Introduction to programming language (basic)
Introduction to programming language (basic)
 
CS3251-_PIC
CS3251-_PICCS3251-_PIC
CS3251-_PIC
 
Computer programming
Computer programmingComputer programming
Computer programming
 
Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Unit 1
Unit 1Unit 1
Unit 1
 
Software Concepts Notes
Software Concepts NotesSoftware Concepts Notes
Software Concepts Notes
 

Recently uploaded

HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 

Recently uploaded (20)

HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 

Introduction of c language

  • 2. What is language Akhilesh Maithani (akhimaithani65@gmail.com)  The method of human communication, either spoken or written, consisting of the use of words in a structured and conventional way.
  • 3. What is programming language Akhilesh Maithani (akhimaithani65@gmail.com)  A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer.
  • 4. Type of programming languages Akhilesh Maithani (akhimaithani65@gmail.com)  There are four type of programming languages  1- Machine Language  2- Assembly Language  3-High Level Language
  • 5. First Generation - Machine Language (code) Akhilesh Maithani (akhimaithani65@gmail.com) Machine language programs were made up of instructions written in binary code.  This is the “native” language of the computer.  Each instruction had two parts: Operation code, Operand  Operation code (Opcode): The command part of a computer instruction.  Operand: The address of a specific location in the computer’s memory.  Hardware dependent: Could be performed by only one type of computer with a particular CPU.
  • 6. Machine level language Akhilesh Maithani (akhimaithani65@gmail.com)  It understands the language of the binary digits, 0 and 1.  We may write a program in whichever language we want, but it is finally converted into the language of 0s and 1s before it gets executed.  Writing a program in machine language is definitely very difficult.  It is not possible to memorize a long string of 0s and 1s for every instruction that you want to derive executed.
  • 8. Assembly language Akhilesh Maithani (akhimaithani65@gmail.com)  Assembly language programs are made up of instructions written in mnemonics.  Mnemonics: Uses convenient alphabetic abbreviations to represent operation codes, and abstract symbols to represent operands.  Each instruction had two parts: Operation code, Operand  Hardware dependent.  Because programs are not written in 1s and 0s, the computer must first translate the program before it can be executed.
  • 9. Akhilesh Maithani (akhimaithani65@gmail.com) An opcode is a single instruction that can be executed by the CPU. In assembly language mnemonic form an opcode is a command such as MOV or ADD or JMP.  For example MOV, AL, 34h  The opcode is the MOV instruction. The other parts are called the 'operands'.  Operands are manipulated by the opcode.  In this example, the operands are the register named AL and the value 34 hex
  • 11. High level language Akhilesh Maithani (akhimaithani65@gmail.com)  Use statements that resemble English phrases combined with mathematical terms needed to express the problem or task being programmed.  Transportable: NOT-Hardware dependent.  Because programs are not written in 1s and 0s, the computer must first translate the program before it can be executed.
  • 12. Difference b/w high level and low level language Akhilesh Maithani (akhimaithani65@gmail.com) High Level 1. Easily understood by humans 2. Uses English like words 3. Easy to locate and identify errors 4. Must be translated before the computer can understand it Low Level 1. Understood by computers without the need for translation 2. Difficult for humans to read and understand 3. Take up a lot of space to write down 4. Its difficult to spot errors in the code
  • 13. Translators Akhilesh Maithani (akhimaithani65@gmail.com)  All programs must be translated before their instructions can be executed.  Computer languages can be grouped according to which translation process is used to convert the instructions into binary code:  Assemblers  Interpreters  Compilers
  • 14. Assembled languages: Akhilesh Maithani (akhimaithani65@gmail.com)  Assembler: a program used to translate Assembly language programs.  Produces one line of binary code per original program statement.  The entire program is assembled before the program is sent to the computer for execution.
  • 15. Interpreted Languages: Akhilesh Maithani (akhimaithani65@gmail.com)  Interpreter: A program used to translate high-level programs.  Translates one line of the program into binary code at a time:  An instruction is fetched from the original source code.  The Interpreter checks the single instruction for errors. (If an error is found, translation and execution ceases. Otherwise…)  The instruction is translated into binary code.  The binary coded instruction is executed.  The fetch and execute process repeats for the entire program.
  • 16. Compiled languages Akhilesh Maithani (akhimaithani65@gmail.com)  Compiler: a program used to translate high-level programs.  Translates the entire program into binary code before anything is sent to the CPU for execution.  The translation process for a compiled program:  First, the Compiler checks the entire program for syntax errors in the original source code.  Next, it translates all of the instructions into binary code. • Two versions of the same program exist: the original source code version, and the binary code version (object code).  Last, the CPU attempts execution only after the programmer requests that the program be executed
  • 17. Error Akhilesh Maithani (akhimaithani65@gmail.com)  A software bug is an error, failure, or fault in a computer program or system that causes it to produce an incorrect or unexpected result, or to behave in unintended ways.
  • 18. Types of error Akhilesh Maithani (akhimaithani65@gmail.com)  There are basically three types of errors that you must contend with when writing computer programs:  Syntax errors  Runtime errors  Logic errors
  • 19. Syntax Error Akhilesh Maithani (akhimaithani65@gmail.com)  Syntax errors represent grammar errors in the use of the programming language. Common examples are:  Misspelled variable and function names  Missing semicolons  Improperly matches parentheses, square brackets, and curly braces  Incorrect format in selection and loop statements
  • 20. Runtime error Akhilesh Maithani (akhimaithani65@gmail.com)  Runtime errors occur when a program with no syntax errors asks the computer to do something that the computer is unable to reliably do. Common examples are:  Trying to divide by a variable that contains a value of zero  Trying to open a file that doesn't exist  There is no way for the compiler to know about these kinds of errors when the program is compiled
  • 21. Logic errors Akhilesh Maithani (akhimaithani65@gmail.com)  Logic errors occur when there is a design flaw in your program. Common examples are:  Multiplying when you should be dividing  Adding when you should be subtracting  Opening and using data from the wrong file  Displaying the wrong message
  • 22. Introduction of c language Akhilesh Maithani (akhimaithani65@gmail.com)  C is a programming language developed at AT & T’s Bell Laboratories of USA in 1972.  It was designed by a man named Dennis Ritchie.  C is popular because it is reliable, simple and easy to use.  The origin of C is closely tied to the development of the Unix operating system, originally implemented in assembly language on a PDP-7 by Ritchie and Thompson, incorporating several ideas from colleagues.
  • 23. Akhilesh Maithani (akhimaithani65@gmail.com) Algol is an early high-level computer programming language devised to carry out scientific calculations. BCPL (Basic Combined Programming Language) is a procedural, imperative, and structured computer progra mming language
  • 24. Features of C Akhilesh Maithani (akhimaithani65@gmail.com)  The most important features of C Language are –  Portability  Modularity  Flexibility  Speed  Extensibility  Case Sensitive
  • 25. Portability Akhilesh Maithani (akhimaithani65@gmail.com)  This feature refers to the use of C Language program on different platforms without any change of configuration. So C Languages program is independent of platforms.
  • 26. Modularity Akhilesh Maithani (akhimaithani65@gmail.com)  Modularity is the most important feature of structured programming language.  This feature refer to the breakdown of large C Language into small modules.  Due to modularity features, complications of a program occurs in time and debugging of program will become faster.
  • 27. Flexibility Akhilesh Maithani (akhimaithani65@gmail.com)  This feature refer to the programmer’s involvements and control on the language.  There are number of reserve words in C Languages which help the programmer to take control over of language and modified the structure of the program.
  • 28. Speed Akhilesh Maithani (akhimaithani65@gmail.com)  As C Language supports the system programming so it is also called as middle level language. Due to this factor, the program of C Language is compiled and execute with more speed as compared to program of other high level language.
  • 29. Extensibility Akhilesh Maithani (akhimaithani65@gmail.com)  In C Language Program, New Feature can be added at any time by programmer. So, C Language program is extensible.
  • 30. Case sensitive Akhilesh Maithani (akhimaithani65@gmail.com)  C Language is a case sensitive language that is it can differentiate the character is either upper case or lower case. All type words either reserve words or user defined words are case sensitive.
  • 31. Steps in learning c Akhilesh Maithani (akhimaithani65@gmail.com) Alphabets Digit Special Symbols Constants Variable Keywords Instructions Program
  • 32. The C character Set Akhilesh Maithani (akhimaithani65@gmail.com)  A character denotes any alphabets, digit, or special symbol used to represent information.  Valid alphabets numbers and special symbols used in C :-  Alphabets – A,B,…………………..,Y,Z a,b,………,y,z.  Digits – 0,1,2,3,4,5,6,7,8,9  Special Symbols - ~ ‘ ! @ # % ^ & * ( ) _ + = | { } [ ] : ; “ ‘ < > , . / ?
  • 33. Constant Akhilesh Maithani (akhimaithani65@gmail.com)  A constant is an entity that doesn’t change .  Type of C constant :- (i) Primary Constant Integer Constant, Real Constant, Character Constant. (ii) Secondary Constant Array, Pointer, Structure, Union, Enum, etc.
  • 34. Rules for Constructing Integer constant Akhilesh Maithani (akhimaithani65@gmail.com)  An integer constant must have at least one digit.  It must not have a decimal point.  It can be either positive or negative.  If no sign precedes an integer constant, it is assumed to be positive.  No commas or blank are allowed within an integer constant.  The allowable range for integer constants is -32768 to 32767.
  • 35. Rules for constructing real constant Akhilesh Maithani (akhimaithani65@gmail.com)  A real constant must have at least one digit.  It must have a decimal point.  It could be either positive or negetive.  Default sign is positive.  No commas or blanks are allowed within a real constant.
  • 36. Rules for constructing character constant Akhilesh Maithani (akhimaithani65@gmail.com)  A character constant is a single alphabet, a single digit or a single special symbol enclosed within singh inverted commas.  Both the inverted commas should point to the left . For example, ’A’ is a valid character constant whereas ‘A’ is not.  The maximum length of a character constant can be 1 Character.
  • 37. Variable Akhilesh Maithani (akhimaithani65@gmail.com)  A variable is an entity that may change, or an entity that may vary during program execution. Variables name are names given to location in the memory. These location can contain integer, real or character constant.
  • 38. Rules for constructing variable name Akhilesh Maithani (akhimaithani65@gmail.com)  A variable name is any combination of 1 to 31 alphabets, digits or underscores. Some compiler allow variable name whose length could be upto 247 characters. Still, it would be safer to stick to the rule of 31 character. Do not create unnecessarily long variable names as it adds to your typing effort.  The first character in the variable name must be an alphabet or underscore.  No commas, or blanks are allowed within avariable name.  No special symbol other than an underscore can be used in variable name.
  • 39. Keywords Akhilesh Maithani (akhimaithani65@gmail.com)  Keywords are the words whose meaning has already been explained to the C compiler.  The Keywords cannot be used as a variable names.  There are 32 Keywords available in C which are as follows :- auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto sizeof volatile do if static while