SlideShare a Scribd company logo
1 of 34
OVERVIEW OF C
by
C.CHANDRAPRIYA, M.sc
FATHER OF ‘C’ LANGUAGE
INTRODUCTION
• C is one of the most popular computer languages today.
• C language has evolved from three different structured language ALGOL, BCPL and
B language.
• C was an offspring of the ‘Basic Combined Programming Language’(BCPL) called
B language, developed at Cambridge University in 1960.
• B language invented by Ken Thompson developed by Martin Richards.
• B language was modified by Dennis Ritchie at AT & T’s Bell laboratories in 1972.
• The new language was named C.
• C adopted by ‘American National Standard Institute’(ANSI).
• In 1990, a version of C language was approved by the ‘International Standard
Organisation’(ISO) and that version of C is also referred to as C89 and C99.
KEN THOMPSON DENNIS RITCHIE
HISTORY OF C
Year Developed by
1960 International Group
1967 Martin Richard
1970 Ken Thompson
1973 Dennis Ritchie
1989 ANSI Committee
1990 ISO Committee
ALGOL
BCPL
B
Traditional C
ANSI CIS C
ANSI/ISO C
FEATURES OF C
• C has been written in assembly language.
• C is a high-level structured oriented programming language.
• C is a robust language with rich set of built-in function and operators.
• Programs written in C are efficient and fast.
• C is highly portable, programs once written in C can be run on another machines
with minor or no modification.
• C is basically a collection of C library functions, we can also create our own
function and add it to the C library.
• C is easily extensible.
BEST OF C
• One of the early programming languages.
• Still the best programming language to learn quickly.
• C language is reliable, simple and easy to use.
• C language is a structured language.
• Modern programming concepts are based on C.
• It can be compiled on a variety of computer platforms.
• Universities preferred to add C programming in their courseware.
• C program can be viewed as a group of building blocked called function.
APPLICATIONS
C language has widely uses, some main uses are given below.
• Used to develop software's that control embedded systems. Examples of some
embedded system are Washing machine, Microwave oven, etc.
• For creating computer applications.
• UNIX Operating System is developed in C language.
BASIC STRUCTURE OF C PROGRAM
More section
Documentation Section
link Section
Definition Section
Global Declaration Secation
{
Declaration Part
Executable Part
}
Subprogram Section
Function 1
Function 2 ( User – defined
. Function)
.
Function n
EXAMPLE
#include<studio.h> / link section /
int total=0; / Global declaration and definition section /
int sum(int,int); / Function declaration section /
int main() / main function /
{
printf(“ this is a C programn”);
total=sum(1,1);
printf(“sum of two numbers:%dn”, total);
return 0;
}
int sum(int a, int b) / User defined function /
{ / Definition section /
return a+b;
}
DESCRIPTION FOR EACH SECTION
Documentation Section:
we can give comment about the program, create or modified
date, author name etc.
The character or words or anything which are given between
“/*” and “*/”, won’t be considered by C compiler for compilation process.
There will be ignored by C compiler during compilation.
Link Section:
The link section consists of the header files of the functions that
are used in the program.
It provides instructions to the compiler to link functions from the
system library.
CONT.…
Definition Section:
All the symbolic constants are written in definition section. Macros
are know as symbolic constants.
Global Declaration Section:
The global variables that can be used anywhere in the program are
declared in global declaration section.
This section also declares the user defined functions.
FUNCTION PROTOTYPE DECLARATION SECTION:
Function prototype give many information about a function like
return type, parameter names used inside the function
CONT.….
main() Function section:
Every C program is started from main function and this function
contain two major sections called
Declaration Section and
Executable Section.
Declaration section declares all the variables that are used in executable part.
User Defined Function Section:
User can define their own function in this section which perform
particular task as per the user requirement.
EXECUTING A “C” PROGRAM
Executing a program written in C involves a series of step.
There are:
Creating the Program.
Compiling the program.
Linking the program with function that are needed from the C library.
Executing the program.
PROCESS OF COMPILING AND RUNNING A C PROGRAM
COMPILER
Definition of compiler:
A Compiler is computer software that translate source code into
object code.
CONT.…
Compiler takes high level human readable program as input and
convert it into the lower level code.
This conversion takes place using different phases.
Different phases of compilers:
Analysis phase
Synthesis phase
ANALYSIS PHASE:
Analysis phase contain
Lexical analysis
Syntax analysis
Semantic analysis
LEXICAL ANALYSIS:
Task of lexical analysis is to read the input characters and produce
as output a sequence of Tokens that the parser user for syntax analysis.
Token
Source Lexical Parser
Program analyser
Get next
token
symbol
table
Lexical Analyser is First Phase of compiler.
Input to lexical analyser is “Source Code”.
CONT.….
Lexical analysis identifies different Lexical units in a Source code.
Different Lexical classes or Tokens or Lexemes.
Identifiers
Constants
Keywords
Operators
Lexical analyzer is also called “Linear Phase” or “Linear Analysis” or
“Scanning”.
Individual Token is also called Lexeme.
Lexical analyzer’s output is given to Syntax analysis.
SYNTAX ANALYSIS
• It is Second phases of compiler after Lexical Analyzer.
• It is also called as Hierarchical Analysis or Parsing.
• It Groups Tokens of source program into Grammatical Production.
• In short Syntax analysis generates Parse tree.
SYNTAX ANALYSIS: PARSE TREE
x = a + b;
It this statement syntax analyzer will create a parse tree from the
Tokens.
Assignment statement
=
Identifier Expression
x +
Identifier Identifier
a b
PARSE TREE: EXPLANATION
Syntax analyzer will check only Syntax not the meaning of
Statement.
explanation:
Addition operator plus (‘+’) operator on the two operands.
Syntax analyzer will just check whether plus operator has two
operands or not.
It does not checks the type of operands.
SEMANTIC ANALYSIS
Semantic analysis is the third phase of compiler.
Data type of Fist operand
Data type of Second operand
Check whether + is binary or unary
Check for number of operands supplied to operator supplied
to Operator Depending on type of operator (Unary / Binary / Ternary)
SOME BASIC SYNTAX RULE FOR C PROGRAM
• C is a case sensitive language so all C instruction must be written in lower case
letter.
• All C statement must be end with a semicolon.
• Whitespace is used in C describe blanks and tabs.
• Whitespace is required between keywords and identifiers.
SAMPLE C PROGRAM
#include<studio.h>
main( )
{
printf(“hi slide share”);
}
output:
hi slide share
PROGRAM EXPLANATION
Header File:
standard input and output (predefined)
#include<studio.h>
pre-processor directive
The pre-processor is a software program that will expand the source code while the program
is compiled.
pre-defined is used to display the results on the standard output.
Syntax:
#include<path-space>
< > angle-bracket form, pre-processor to search the directories that are specified by the
include.
CONT.….
main( )
This is the point where the execution begins when the program is run.
main( ) is the calling and also user-defined function.
{ } – name of parentheses (the two brackets properly called Braces).
This indication to the compiler that this is a function.
“ ” – The end result is that whatever is included between the Quotation marks
will be displayed on the monitor when the program is run.
CONT.….
; (semi-colon) – used as a statement Terminator.
so is required as a signal to the compiler that this line is complete.
printf (executable statement) – is the predefined, standard C function for printing
output.
n (new line character) – C compiler consider the combination of the(black lash)
and (letter n) as a one character. So it return the cursor to
the left side of the monitor and print the new line.
ADVANTAGES
• C is the building block for many other programming languages.
• Programs written in C are highly portable languages.
• Several standard functions are the (like in-built) that can be used to develop
programs.
• C program are basically collections of C library function, and it’s also easy to add
own function in to the C library.
• The modular structure make code debugging, maintenance and testing easier.
DISADVANTAGES
• C does not provide Object Oriented Programming(OOP) concepts.
• There is no runtime checking in C language.
• There is no strict type checking.
Example, we can pass on integer value.
• There is no concepts of Namespace in C.
• C does not provided binding or wrapping up of data in a single unit.
• C does not provide Constructor and Destructor.
Overview of c
Overview of c
Overview of c

More Related Content

What's hot

introduction to C programming (C)
introduction to C programming (C)introduction to C programming (C)
introduction to C programming (C)Abhishek Walia
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGJEENA SARA VIJU
 
C programming language
C programming languageC programming language
C programming languageMaha lakshmi
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programmingManoj Tyagi
 
Notes of c programming 1st unit BCA I SEM
Notes of c programming  1st unit BCA I SEMNotes of c programming  1st unit BCA I SEM
Notes of c programming 1st unit BCA I SEMMansi Tyagi
 
introduction to c language
 introduction to c language introduction to c language
introduction to c languageRai University
 
An Overview of Programming C
An Overview of Programming CAn Overview of Programming C
An Overview of Programming CNishargo Nigar
 
COM1407: Introduction to C Programming
COM1407: Introduction to C Programming COM1407: Introduction to C Programming
COM1407: Introduction to C Programming Hemantha Kulathilake
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C ProgrammingMOHAMAD NOH AHMAD
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)indrasir
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programmingRokonuzzaman Rony
 
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTTC programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTTBatra Centre
 

What's hot (20)

introduction to C programming (C)
introduction to C programming (C)introduction to C programming (C)
introduction to C programming (C)
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
 
C programming language
C programming languageC programming language
C programming language
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Notes of c programming 1st unit BCA I SEM
Notes of c programming  1st unit BCA I SEMNotes of c programming  1st unit BCA I SEM
Notes of c programming 1st unit BCA I SEM
 
C Language
C LanguageC Language
C Language
 
introduction to c language
 introduction to c language introduction to c language
introduction to c language
 
An Overview of Programming C
An Overview of Programming CAn Overview of Programming C
An Overview of Programming C
 
C language
C languageC language
C language
 
COM1407: Introduction to C Programming
COM1407: Introduction to C Programming COM1407: Introduction to C Programming
COM1407: Introduction to C Programming
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
C basics
C   basicsC   basics
C basics
 
Learning the C Language
Learning the C LanguageLearning the C Language
Learning the C Language
 
Unit4
Unit4Unit4
Unit4
 
Tokens_C
Tokens_CTokens_C
Tokens_C
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
C programming part1
C programming part1C programming part1
C programming part1
 
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTTC programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
 
C languaGE UNIT-1
C languaGE UNIT-1C languaGE UNIT-1
C languaGE UNIT-1
 

Similar to Overview of c

INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfSubramanyambharathis
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1SURBHI SAROHA
 
Intro to cprogramming
Intro to cprogrammingIntro to cprogramming
Intro to cprogrammingskashwin98
 
2.Overview of C language.pptx
2.Overview of C language.pptx2.Overview of C language.pptx
2.Overview of C language.pptxVishwas459764
 
C Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYC Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYRajeshkumar Reddy
 
67404923-C-Programming-Tutorials-Doc.pdf
67404923-C-Programming-Tutorials-Doc.pdf67404923-C-Programming-Tutorials-Doc.pdf
67404923-C-Programming-Tutorials-Doc.pdfRajb54
 
Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 10 introduction to c language (part1)Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 10 introduction to c language (part1)Nuzhat Memon
 
Learn c language Important topics ( Easy & Logical, & smart way of learning)
Learn c language Important topics ( Easy & Logical, & smart way of learning)Learn c language Important topics ( Easy & Logical, & smart way of learning)
Learn c language Important topics ( Easy & Logical, & smart way of learning)Rohit Singh
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptxMugilvannan11
 
Overview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiOverview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiSowmya Jyothi
 
The C++ Programming Language
The C++ Programming LanguageThe C++ Programming Language
The C++ Programming LanguageProf Ansari
 

Similar to Overview of c (20)

chapter 1.pptx
chapter 1.pptxchapter 1.pptx
chapter 1.pptx
 
C programming
C programmingC programming
C programming
 
C session 1.pptx
C session 1.pptxC session 1.pptx
C session 1.pptx
 
C lecture notes new
C lecture notes newC lecture notes new
C lecture notes new
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1
 
OVERVIEW OF ‘C’ PROGRAM
OVERVIEW OF ‘C’ PROGRAMOVERVIEW OF ‘C’ PROGRAM
OVERVIEW OF ‘C’ PROGRAM
 
Intro to cprogramming
Intro to cprogrammingIntro to cprogramming
Intro to cprogramming
 
2.Overview of C language.pptx
2.Overview of C language.pptx2.Overview of C language.pptx
2.Overview of C language.pptx
 
C Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYC Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDY
 
67404923-C-Programming-Tutorials-Doc.pdf
67404923-C-Programming-Tutorials-Doc.pdf67404923-C-Programming-Tutorials-Doc.pdf
67404923-C-Programming-Tutorials-Doc.pdf
 
Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 10 introduction to c language (part1)Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 10 introduction to c language (part1)
 
Unit-2.pptx
Unit-2.pptxUnit-2.pptx
Unit-2.pptx
 
Learn c language Important topics ( Easy & Logical, & smart way of learning)
Learn c language Important topics ( Easy & Logical, & smart way of learning)Learn c language Important topics ( Easy & Logical, & smart way of learning)
Learn c language Important topics ( Easy & Logical, & smart way of learning)
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptx
 
Overview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiOverview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya Jyothi
 
C programming
C programmingC programming
C programming
 
Basic c
Basic cBasic c
Basic c
 
CS3251-_PIC
CS3251-_PICCS3251-_PIC
CS3251-_PIC
 
The C++ Programming Language
The C++ Programming LanguageThe C++ Programming Language
The C++ Programming Language
 

More from Chandrapriya Rediex

More from Chandrapriya Rediex (8)

5-Unit (CAB).pdf
5-Unit (CAB).pdf5-Unit (CAB).pdf
5-Unit (CAB).pdf
 
unit-4 (CAB).pdf
unit-4 (CAB).pdfunit-4 (CAB).pdf
unit-4 (CAB).pdf
 
CAB - Unit-2.pdf
CAB - Unit-2.pdfCAB - Unit-2.pdf
CAB - Unit-2.pdf
 
CAB unit-1.pdf
CAB unit-1.pdfCAB unit-1.pdf
CAB unit-1.pdf
 
Evolauion of computer converted
Evolauion of computer convertedEvolauion of computer converted
Evolauion of computer converted
 
Enhanced adaptive security system for SMS – based One Time Password
Enhanced adaptive security system for SMS – based One Time Password Enhanced adaptive security system for SMS – based One Time Password
Enhanced adaptive security system for SMS – based One Time Password
 
Enhanced adaptive security system for SMS – based One Time Password
Enhanced adaptive security system for SMS – based One Time PasswordEnhanced adaptive security system for SMS – based One Time Password
Enhanced adaptive security system for SMS – based One Time Password
 
Character set of c
Character set of cCharacter set of c
Character set of c
 

Recently uploaded

ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 

Recently uploaded (20)

ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 

Overview of c

  • 2. FATHER OF ‘C’ LANGUAGE
  • 3. INTRODUCTION • C is one of the most popular computer languages today. • C language has evolved from three different structured language ALGOL, BCPL and B language. • C was an offspring of the ‘Basic Combined Programming Language’(BCPL) called B language, developed at Cambridge University in 1960. • B language invented by Ken Thompson developed by Martin Richards. • B language was modified by Dennis Ritchie at AT & T’s Bell laboratories in 1972. • The new language was named C. • C adopted by ‘American National Standard Institute’(ANSI). • In 1990, a version of C language was approved by the ‘International Standard Organisation’(ISO) and that version of C is also referred to as C89 and C99.
  • 5. HISTORY OF C Year Developed by 1960 International Group 1967 Martin Richard 1970 Ken Thompson 1973 Dennis Ritchie 1989 ANSI Committee 1990 ISO Committee ALGOL BCPL B Traditional C ANSI CIS C ANSI/ISO C
  • 6. FEATURES OF C • C has been written in assembly language. • C is a high-level structured oriented programming language. • C is a robust language with rich set of built-in function and operators. • Programs written in C are efficient and fast. • C is highly portable, programs once written in C can be run on another machines with minor or no modification. • C is basically a collection of C library functions, we can also create our own function and add it to the C library. • C is easily extensible.
  • 7. BEST OF C • One of the early programming languages. • Still the best programming language to learn quickly. • C language is reliable, simple and easy to use. • C language is a structured language. • Modern programming concepts are based on C. • It can be compiled on a variety of computer platforms. • Universities preferred to add C programming in their courseware. • C program can be viewed as a group of building blocked called function.
  • 8. APPLICATIONS C language has widely uses, some main uses are given below. • Used to develop software's that control embedded systems. Examples of some embedded system are Washing machine, Microwave oven, etc. • For creating computer applications. • UNIX Operating System is developed in C language.
  • 9. BASIC STRUCTURE OF C PROGRAM More section Documentation Section link Section Definition Section Global Declaration Secation { Declaration Part Executable Part } Subprogram Section Function 1 Function 2 ( User – defined . Function) . Function n
  • 10. EXAMPLE #include<studio.h> / link section / int total=0; / Global declaration and definition section / int sum(int,int); / Function declaration section / int main() / main function / { printf(“ this is a C programn”); total=sum(1,1); printf(“sum of two numbers:%dn”, total); return 0; } int sum(int a, int b) / User defined function / { / Definition section / return a+b; }
  • 11. DESCRIPTION FOR EACH SECTION Documentation Section: we can give comment about the program, create or modified date, author name etc. The character or words or anything which are given between “/*” and “*/”, won’t be considered by C compiler for compilation process. There will be ignored by C compiler during compilation. Link Section: The link section consists of the header files of the functions that are used in the program. It provides instructions to the compiler to link functions from the system library.
  • 12. CONT.… Definition Section: All the symbolic constants are written in definition section. Macros are know as symbolic constants. Global Declaration Section: The global variables that can be used anywhere in the program are declared in global declaration section. This section also declares the user defined functions. FUNCTION PROTOTYPE DECLARATION SECTION: Function prototype give many information about a function like return type, parameter names used inside the function
  • 13. CONT.…. main() Function section: Every C program is started from main function and this function contain two major sections called Declaration Section and Executable Section. Declaration section declares all the variables that are used in executable part. User Defined Function Section: User can define their own function in this section which perform particular task as per the user requirement.
  • 14. EXECUTING A “C” PROGRAM Executing a program written in C involves a series of step. There are: Creating the Program. Compiling the program. Linking the program with function that are needed from the C library. Executing the program.
  • 15. PROCESS OF COMPILING AND RUNNING A C PROGRAM
  • 16. COMPILER Definition of compiler: A Compiler is computer software that translate source code into object code.
  • 17. CONT.… Compiler takes high level human readable program as input and convert it into the lower level code. This conversion takes place using different phases. Different phases of compilers: Analysis phase Synthesis phase
  • 18. ANALYSIS PHASE: Analysis phase contain Lexical analysis Syntax analysis Semantic analysis
  • 19. LEXICAL ANALYSIS: Task of lexical analysis is to read the input characters and produce as output a sequence of Tokens that the parser user for syntax analysis. Token Source Lexical Parser Program analyser Get next token symbol table Lexical Analyser is First Phase of compiler. Input to lexical analyser is “Source Code”.
  • 20. CONT.…. Lexical analysis identifies different Lexical units in a Source code. Different Lexical classes or Tokens or Lexemes. Identifiers Constants Keywords Operators Lexical analyzer is also called “Linear Phase” or “Linear Analysis” or “Scanning”. Individual Token is also called Lexeme. Lexical analyzer’s output is given to Syntax analysis.
  • 21. SYNTAX ANALYSIS • It is Second phases of compiler after Lexical Analyzer. • It is also called as Hierarchical Analysis or Parsing. • It Groups Tokens of source program into Grammatical Production. • In short Syntax analysis generates Parse tree.
  • 22. SYNTAX ANALYSIS: PARSE TREE x = a + b; It this statement syntax analyzer will create a parse tree from the Tokens. Assignment statement = Identifier Expression x + Identifier Identifier a b
  • 23. PARSE TREE: EXPLANATION Syntax analyzer will check only Syntax not the meaning of Statement. explanation: Addition operator plus (‘+’) operator on the two operands. Syntax analyzer will just check whether plus operator has two operands or not. It does not checks the type of operands.
  • 24. SEMANTIC ANALYSIS Semantic analysis is the third phase of compiler. Data type of Fist operand Data type of Second operand Check whether + is binary or unary Check for number of operands supplied to operator supplied to Operator Depending on type of operator (Unary / Binary / Ternary)
  • 25. SOME BASIC SYNTAX RULE FOR C PROGRAM • C is a case sensitive language so all C instruction must be written in lower case letter. • All C statement must be end with a semicolon. • Whitespace is used in C describe blanks and tabs. • Whitespace is required between keywords and identifiers.
  • 26. SAMPLE C PROGRAM #include<studio.h> main( ) { printf(“hi slide share”); } output: hi slide share
  • 27. PROGRAM EXPLANATION Header File: standard input and output (predefined) #include<studio.h> pre-processor directive The pre-processor is a software program that will expand the source code while the program is compiled. pre-defined is used to display the results on the standard output. Syntax: #include<path-space> < > angle-bracket form, pre-processor to search the directories that are specified by the include.
  • 28. CONT.…. main( ) This is the point where the execution begins when the program is run. main( ) is the calling and also user-defined function. { } – name of parentheses (the two brackets properly called Braces). This indication to the compiler that this is a function. “ ” – The end result is that whatever is included between the Quotation marks will be displayed on the monitor when the program is run.
  • 29. CONT.…. ; (semi-colon) – used as a statement Terminator. so is required as a signal to the compiler that this line is complete. printf (executable statement) – is the predefined, standard C function for printing output. n (new line character) – C compiler consider the combination of the(black lash) and (letter n) as a one character. So it return the cursor to the left side of the monitor and print the new line.
  • 30. ADVANTAGES • C is the building block for many other programming languages. • Programs written in C are highly portable languages. • Several standard functions are the (like in-built) that can be used to develop programs. • C program are basically collections of C library function, and it’s also easy to add own function in to the C library. • The modular structure make code debugging, maintenance and testing easier.
  • 31. DISADVANTAGES • C does not provide Object Oriented Programming(OOP) concepts. • There is no runtime checking in C language. • There is no strict type checking. Example, we can pass on integer value. • There is no concepts of Namespace in C. • C does not provided binding or wrapping up of data in a single unit. • C does not provide Constructor and Destructor.