SlideShare a Scribd company logo
1 of 39
Learning C Language
Dr. D. R. Gholkar
M.Com, MCM, MBA (Finance)
Ph. D (Entrepreneurship Development)
Mo. N0. 9011355151
Deep C
HISTORY OF PROGRAMMING LANGUAGE
 Machine Language
 Assembly Language
 High Level Language
Language Translators
Compiler
Interpreter
INTRODUCTION TO C LANGUAGE
 What is C ?
 C is Programming Language
 C is a General Purpose Programming language
 C is a Procedure Oriented Language
 C is a Structured Language
 C is a Middle Level Language
 C is a Superset Language of all the Programming
Language
HISTORY OF C LANGUAGE
ALGOL 60
(BY AN INTERNATIONAL COMMITTEE, 1960) IT WAS TOO ABSTRACT &
TOO GENERAL
CPL
(BY CAMBRIDGE & LONDON UNIVERSITY,
1963)
DROWBACKS/SHORTCOMMINGS
BCPL
HARD TO LEARN & DIFFICULT
TO IMPLEMENT
B
(MARTIN RICHARDS AT
CAMBRIDGEUNIVERSITY, 1967 )
(KEN THOMSON AT BELL LABS, 1970)
TOO LESS POWERFULL &
TOO LESS SPECIFIC
MACHINE DEPENDENT &
TYPELESS
C
(DENNIS RITCHE AT BELL LABS, 1972
IMPORTANCE OF C LANGUAGE
 FLEXIBILITY
 POWERFULL
 SMALL SIZE
 MODULAR DESIGN
 PORTABILITY
 HIGH LEVEL STRUCTURED LANGUAGE FEATURES
 LOW LEVEL FEATURES
 USE OF POINTERS
 EASY TO LEARN
 EASY TO DEBUG
 EFFICIENCY ( EASY TO EXECUTE )
 EASY TO USE
 RELIABLE
 CREATING A SOURCE CODE
 COMPILING THE SOURCE CODE
 LINKING THE SOURCE CODE
 RUNNING THE EXECUTABLE CODE
WRITING & EXECUTING A C PROGRAM
EDITOR
WRITTEN C PROGRAM
PRE
PROCESSOR
COMPILER
PRE-PROSSED CODE
COMPILATION
OBJECT
CODE
LINKER
EXECUTABLE
CODE
Linking
.OBJ
FILE
.EXE
FILE
START
TYPE THE PROGRAM
COMPILER SOURCE CODE
SYNTAX
ERROR
LINK THE PROGRAM
EXECUTE
LOGICAL
ERROR
STOP
WRITTEN
C CODE
EDIT PROGRAMME
LIBRARY +
OBJECT
PROGRAMME
CORRECT
I/O
DATA
SOURCE
PROGRAMME FILE.C
OBJECT
PROGRAMME
NO
NO
YES
FILE.OBJ
EXECUTABLE
CODE
FILE.EXE
Fig: Flowchart of execution of c
programme
STRUCTURE OF C PROGRAMME
DOCUMENTATION SECTION1
LINK SECTION
DEFINATION SECTION
GLOBAL DECLARATION
SECTION
MAIN () SECTION
2
3
4
5
OPTIONAL
COMPULSORY
OPTIONAL
OPTIONAL
COMPULSORY
{
Declarative part
Executable part
}
C TOCKENS
KEYWORDS
OPERATORS
IDENTIFIERS CONSTANTS VARIABLES
PRIMARY/
DERIVED
STRUCTURED
USER
DEFINED
EMPTY
DATA SET
1. Int
2. Flot
3. Char
4. double
1. Array
2. Structure
3. Union
4. pointer
1. enum 1. void
DATA TYPES
Fundamental Data Types
Data Types Description Size ( In Bytes ) Range
Int An integer number 2 bytes -32768 to 32767
Float A single precision
floating point number
4 bytes -2147483648 to
2147483647
Char A single character 1 byte -128 to 127
Double A double precision
floating point number
8 byte 1.7 e-308 to 1.7 e+308
Void Empty data type 0 Valueless
1. ARITHMETIC OPERATORS 5 + - * / %
2. RELATIONAL OPERATORS 6 < > <= >= == !=
3. LOGICAL OPERATORS 3 && || !
4. ASSIGNMENT OPERATORS 1 =
5. INCREMENT & DECREMENT OPERATORS 2++ --
6. CONDITIONAL OPERATORS ? : / if else
7. BITWISE OPERATORS 6 & | << >> ~
8. OTHER OPERATORS 7 , sizeof() typecast() & * [] ()
OPERATORS
1. Null Statement  ; on line
2. Expression Statement  assignment/function call
3. Compound Statement { }
4. Selection Statement  condition check if if else
5. Iteration Statement  Iteration while do while for
6. Jump Statement  go to break continue
7. Labeled Statement  xx
STATEMENT
Def: Computer can take the decision but taking a decision for computer statement is
required.
SELECTION/DECISION MAKING STATEMNET
 If
 If …..else
 Nested if …. Else
 If else ladder
 Switch statement
ITERATIVE / LOOPING STATEMENT
 While Loop
 Do….while Loop
 For Loop
1. While Loop
 Entry controlled loop / top tested loop
 Syntax :
 Initialization;
 While ( Test_condition)
 {
 Body of the while loop;
 }
2. Do….while Loop
 Exit controlled loop / bottom tested loop
 Syntax :
 Initialization;
 Do
 {
 Body of the do loop;
 }
 While (Test_condition);
3. For Loop
 Most powerful, flexible & commonly used Loop
 Top tested
 Syntax :
 For(initialization; test_condition; incr/decr)
 {
 Body of the for loop
 }
Jumping statement
 Break statement : whole program terminated
 Continue statement : that particular stat is terminated
 Goto statement
Array
Definition: Array is the collection of similar type of data elements.
Types of Array
1. One dimensional array
2. Two dimensional array / matrix
3. Multi dimensional array
More than one values can be stored in a variable of a similar type.
Array declaration does following things:
 The name of the array
 The type of the array
 The dimension of the array
 The size of the array
 For ex:
 int a[10];
 int a[2] [2];
 int a[2] [3] [3];
Handling of C character set
 Reading & writing string
 Combining string together - strcat
 Copying one string to another – strcpy
 Comparing string for equality – strcmp
 Calculating length of string – strlen
Def : A string is an array of characters terminated by a special character Null
(‘0’)
1.Combining string together
 /* strcat demo */
 Void main()
 {
 Char str1[ ] = “Bill”;
 Char str2[] = “Gates”;
 Strcat (str1, “ “);
 Strcat (str1, str2);
 Printf(“n%s”, str1);
 }
 Otuput :
 Bill Gates
2. Copying string together :
 Void main()
 {
 Char str1[ ]= “BCA”;
 Char str2[ ]= “BBA”;
 Char str3[ ];
 Strcpy(str3,str1);
 Strcat(str3,str2);
 Printf(%s”,str3);
 Output :
 BCABBA
3.Comparing string together:
 Void main()
 Char city1[ ]= “Bombay”;
 Char city2[ ]= “Osmanabad”;
 Int i,j;
 i=strcmp(city1,city2);
 j=strcmp(city2,city2);
 Printf(“%d”, i);
 Printf(%d”,j);
 }
B=66
O=79
Output:
-13
13
4.Calculating the length of string :
 Void main()
 {
 Int I;
 Char city[]= “Osmanabad”;
 i=strlen(city);
 Printf(“%d”,strlen(city));
 }
 Output:
 9
Def: A structure is a collection of different
types of data types grouped together under
a single name. Each variable within the
structure is called a member. The name
given to the structure is called structure
tag.
Syntax :
 Struct tag
 {
 Member1;
 Member2;
 .
 .
 Membern;
 };
 Struct tag instance;
For Ex:
Struct student
{
Char name[20];
Int roll no;
Int marks;
};
Struct student s;
Instance is the structure variable used to initialize the structure
Def: A UNION is a collection of different
types of data types grouped together under
a single name. Each variable within the
union is called a member. The name given
to the union is called union tag.
Syntax :
 union tag
 {
 Member1;
 Member2;
 .
 .
 Membern;
 };
 union tag instance;
For Ex:
union student
{
Char name[20];
Int roll no;
Int marks;
};
unioin student s;
Instance is the structure variable used to initialize the structure
Pointer
 Pointer is an important part of the c language which
provide a powerful flexible way to manipulate the data.
 Reason for using the pointer:
 1. accessing the variable defined outside of the
function.
 2. more efficient in handling data tables.
 3. reduce the length of the program
 4. reduce the complexity
 5. pointer increase the execution speed.
Def: Pointer is the variable which store the address of the
next variable.
FUNCTION
 A function is named- accessed by name
 A function is independent-perform the task on its
own
 Specific task
 It will return the value to the calling program.
Def : A function is a self-contained block of statement
that perform a specific well defined task and may
return the value to the calling program.
TYPES OF FUNCTION
Library function
User defined function
1. Library function
 1.<stdio.h> = printf() & scanf()
 2.<conio.h> = clrscr() & getch()
 3.<math.c> = pow(), exp() & sqrt()
 4.<graphic.c> = circle(), setcolor() & bar()
LIBRARY FILES FUNCTIONS
2. User Defined Functions
 For ex :
 Main()
 {
 /* call to func1()*/
 Func1();
 ----
 ----
 /* call to func2()*/
 Func2();
 ----
 ----
 }
Func1()
{
-----
func3();
}
Func2()
{
-----
-----
}
Func3()
{
----
----
}
THANK YOU, VERY MUCH
END

More Related Content

What's hot

CPU : Structures And Unions
CPU : Structures And UnionsCPU : Structures And Unions
CPU : Structures And UnionsDhrumil Patel
 
C presentation book
C presentation bookC presentation book
C presentation bookkrunal1210
 
C presentation! BATRA COMPUTER CENTRE
C presentation! BATRA  COMPUTER  CENTRE C presentation! BATRA  COMPUTER  CENTRE
C presentation! BATRA COMPUTER CENTRE jatin batra
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C ProgrammingKamal Acharya
 
datatypes_variables_constants
datatypes_variables_constantsdatatypes_variables_constants
datatypes_variables_constantsMicheal Ogundero
 
best notes in c language
best notes in c languagebest notes in c language
best notes in c languageIndia
 
Variables and data types in C++
Variables and data types in C++Variables and data types in C++
Variables and data types in C++Ameer Khan
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constantsvinay arora
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programmingprogramming9
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c languageRai University
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data typesManisha Keim
 
C programinng
C programinngC programinng
C programinngmahi1996
 
introductory concepts
introductory conceptsintroductory concepts
introductory conceptsWalepak Ubi
 
Literals,variables,datatype in C#
Literals,variables,datatype in C#Literals,variables,datatype in C#
Literals,variables,datatype in C#Prasanna Kumar SM
 
C++
C++C++
C++k v
 
What are variables and keywords in c++
What are variables and keywords in c++What are variables and keywords in c++
What are variables and keywords in c++Abdul Hafeez
 

What's hot (20)

CPU : Structures And Unions
CPU : Structures And UnionsCPU : Structures And Unions
CPU : Structures And Unions
 
C presentation book
C presentation bookC presentation book
C presentation book
 
C Structures And Unions
C  Structures And  UnionsC  Structures And  Unions
C Structures And Unions
 
C presentation! BATRA COMPUTER CENTRE
C presentation! BATRA  COMPUTER  CENTRE C presentation! BATRA  COMPUTER  CENTRE
C presentation! BATRA COMPUTER CENTRE
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
 
datatypes_variables_constants
datatypes_variables_constantsdatatypes_variables_constants
datatypes_variables_constants
 
best notes in c language
best notes in c languagebest notes in c language
best notes in c language
 
Variables and data types in C++
Variables and data types in C++Variables and data types in C++
Variables and data types in C++
 
Computer
ComputerComputer
Computer
 
C language
C languageC language
C language
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constants
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programming
 
Methods in C#
Methods in C#Methods in C#
Methods in C#
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c language
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
 
C programinng
C programinngC programinng
C programinng
 
introductory concepts
introductory conceptsintroductory concepts
introductory concepts
 
Literals,variables,datatype in C#
Literals,variables,datatype in C#Literals,variables,datatype in C#
Literals,variables,datatype in C#
 
C++
C++C++
C++
 
What are variables and keywords in c++
What are variables and keywords in c++What are variables and keywords in c++
What are variables and keywords in c++
 

Similar to C language by Dr. Gholkar D. R.

Similar to C language by Dr. Gholkar D. R. (20)

C language by Dr. D. R. Gholkar
C language by Dr. D. R. GholkarC language by Dr. D. R. Gholkar
C language by Dr. D. R. Gholkar
 
C LANGUAGE NOTES
C LANGUAGE NOTESC LANGUAGE NOTES
C LANGUAGE NOTES
 
Theory1&amp;2
Theory1&amp;2Theory1&amp;2
Theory1&amp;2
 
C Programming Intro.ppt
C Programming Intro.pptC Programming Intro.ppt
C Programming Intro.ppt
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Programming in C [Module One]
Programming in C [Module One]Programming in C [Module One]
Programming in C [Module One]
 
Basic Information About C language PDF
Basic Information About C language PDFBasic Information About C language PDF
Basic Information About C language PDF
 
C Programming - Refresher - Part IV
C Programming - Refresher - Part IVC Programming - Refresher - Part IV
C Programming - Refresher - Part IV
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
 
unit 1 (1).pptx
unit 1 (1).pptxunit 1 (1).pptx
unit 1 (1).pptx
 
Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxProgramming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptx
 
C programming language
C programming languageC programming language
C programming language
 
The smartpath information systems c pro
The smartpath information systems c proThe smartpath information systems c pro
The smartpath information systems c pro
 
C notes
C notesC notes
C notes
 
C programming_MSBTE_Diploma_Pranoti Doke
C programming_MSBTE_Diploma_Pranoti DokeC programming_MSBTE_Diploma_Pranoti Doke
C programming_MSBTE_Diploma_Pranoti Doke
 
Aniket tore
Aniket toreAniket tore
Aniket tore
 
Ppt of c vs c#
Ppt of c vs c#Ppt of c vs c#
Ppt of c vs c#
 
C prog ppt
C prog pptC prog ppt
C prog ppt
 
C programming notes
C programming notesC programming notes
C programming notes
 

Recently uploaded

Rapidoform for Modern Form Building and Insights
Rapidoform for Modern Form Building and InsightsRapidoform for Modern Form Building and Insights
Rapidoform for Modern Form Building and Insightsrapidoform
 
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI EraEvolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Eraconfluent
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024MulesoftMunichMeetup
 
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdfThe Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdfkalichargn70th171
 
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIFrom Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIInflectra
 
The Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test AutomationThe Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test AutomationElement34
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanNeo4j
 
Test Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfTest Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfkalichargn70th171
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringPrakhyath Rai
 
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...drm1699
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jNeo4j
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Lisi Hocke
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio, Inc.
 
Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14VMware Tanzu
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Andreas Granig
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...naitiksharma1124
 
Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...Varun Mithran
 

Recently uploaded (20)

Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
 
Rapidoform for Modern Form Building and Insights
Rapidoform for Modern Form Building and InsightsRapidoform for Modern Form Building and Insights
Rapidoform for Modern Form Building and Insights
 
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI EraEvolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Era
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
 
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdfThe Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
 
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIFrom Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST API
 
The Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test AutomationThe Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test Automation
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
 
Test Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfTest Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdf
 
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
 
Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...
 

C language by Dr. Gholkar D. R.

  • 1. Learning C Language Dr. D. R. Gholkar M.Com, MCM, MBA (Finance) Ph. D (Entrepreneurship Development) Mo. N0. 9011355151
  • 3. HISTORY OF PROGRAMMING LANGUAGE  Machine Language  Assembly Language  High Level Language
  • 5.
  • 6. INTRODUCTION TO C LANGUAGE  What is C ?  C is Programming Language  C is a General Purpose Programming language  C is a Procedure Oriented Language  C is a Structured Language  C is a Middle Level Language  C is a Superset Language of all the Programming Language
  • 7. HISTORY OF C LANGUAGE ALGOL 60 (BY AN INTERNATIONAL COMMITTEE, 1960) IT WAS TOO ABSTRACT & TOO GENERAL CPL (BY CAMBRIDGE & LONDON UNIVERSITY, 1963) DROWBACKS/SHORTCOMMINGS BCPL HARD TO LEARN & DIFFICULT TO IMPLEMENT B (MARTIN RICHARDS AT CAMBRIDGEUNIVERSITY, 1967 ) (KEN THOMSON AT BELL LABS, 1970) TOO LESS POWERFULL & TOO LESS SPECIFIC MACHINE DEPENDENT & TYPELESS C (DENNIS RITCHE AT BELL LABS, 1972
  • 8. IMPORTANCE OF C LANGUAGE  FLEXIBILITY  POWERFULL  SMALL SIZE  MODULAR DESIGN  PORTABILITY  HIGH LEVEL STRUCTURED LANGUAGE FEATURES  LOW LEVEL FEATURES  USE OF POINTERS  EASY TO LEARN  EASY TO DEBUG  EFFICIENCY ( EASY TO EXECUTE )  EASY TO USE  RELIABLE
  • 9.  CREATING A SOURCE CODE  COMPILING THE SOURCE CODE  LINKING THE SOURCE CODE  RUNNING THE EXECUTABLE CODE WRITING & EXECUTING A C PROGRAM EDITOR WRITTEN C PROGRAM PRE PROCESSOR COMPILER PRE-PROSSED CODE COMPILATION OBJECT CODE LINKER EXECUTABLE CODE Linking .OBJ FILE .EXE FILE
  • 10. START TYPE THE PROGRAM COMPILER SOURCE CODE SYNTAX ERROR LINK THE PROGRAM EXECUTE LOGICAL ERROR STOP WRITTEN C CODE EDIT PROGRAMME LIBRARY + OBJECT PROGRAMME CORRECT I/O DATA SOURCE PROGRAMME FILE.C OBJECT PROGRAMME NO NO YES FILE.OBJ EXECUTABLE CODE FILE.EXE Fig: Flowchart of execution of c programme
  • 11. STRUCTURE OF C PROGRAMME DOCUMENTATION SECTION1 LINK SECTION DEFINATION SECTION GLOBAL DECLARATION SECTION MAIN () SECTION 2 3 4 5 OPTIONAL COMPULSORY OPTIONAL OPTIONAL COMPULSORY { Declarative part Executable part }
  • 13. PRIMARY/ DERIVED STRUCTURED USER DEFINED EMPTY DATA SET 1. Int 2. Flot 3. Char 4. double 1. Array 2. Structure 3. Union 4. pointer 1. enum 1. void DATA TYPES
  • 14. Fundamental Data Types Data Types Description Size ( In Bytes ) Range Int An integer number 2 bytes -32768 to 32767 Float A single precision floating point number 4 bytes -2147483648 to 2147483647 Char A single character 1 byte -128 to 127 Double A double precision floating point number 8 byte 1.7 e-308 to 1.7 e+308 Void Empty data type 0 Valueless
  • 15. 1. ARITHMETIC OPERATORS 5 + - * / % 2. RELATIONAL OPERATORS 6 < > <= >= == != 3. LOGICAL OPERATORS 3 && || ! 4. ASSIGNMENT OPERATORS 1 = 5. INCREMENT & DECREMENT OPERATORS 2++ -- 6. CONDITIONAL OPERATORS ? : / if else 7. BITWISE OPERATORS 6 & | << >> ~ 8. OTHER OPERATORS 7 , sizeof() typecast() & * [] () OPERATORS
  • 16. 1. Null Statement  ; on line 2. Expression Statement  assignment/function call 3. Compound Statement { } 4. Selection Statement  condition check if if else 5. Iteration Statement  Iteration while do while for 6. Jump Statement  go to break continue 7. Labeled Statement  xx STATEMENT Def: Computer can take the decision but taking a decision for computer statement is required.
  • 17. SELECTION/DECISION MAKING STATEMNET  If  If …..else  Nested if …. Else  If else ladder  Switch statement
  • 18. ITERATIVE / LOOPING STATEMENT  While Loop  Do….while Loop  For Loop
  • 19. 1. While Loop  Entry controlled loop / top tested loop  Syntax :  Initialization;  While ( Test_condition)  {  Body of the while loop;  }
  • 20. 2. Do….while Loop  Exit controlled loop / bottom tested loop  Syntax :  Initialization;  Do  {  Body of the do loop;  }  While (Test_condition);
  • 21. 3. For Loop  Most powerful, flexible & commonly used Loop  Top tested  Syntax :  For(initialization; test_condition; incr/decr)  {  Body of the for loop  }
  • 22. Jumping statement  Break statement : whole program terminated  Continue statement : that particular stat is terminated  Goto statement
  • 23. Array Definition: Array is the collection of similar type of data elements. Types of Array 1. One dimensional array 2. Two dimensional array / matrix 3. Multi dimensional array More than one values can be stored in a variable of a similar type.
  • 24. Array declaration does following things:  The name of the array  The type of the array  The dimension of the array  The size of the array  For ex:  int a[10];  int a[2] [2];  int a[2] [3] [3];
  • 25. Handling of C character set  Reading & writing string  Combining string together - strcat  Copying one string to another – strcpy  Comparing string for equality – strcmp  Calculating length of string – strlen Def : A string is an array of characters terminated by a special character Null (‘0’)
  • 26. 1.Combining string together  /* strcat demo */  Void main()  {  Char str1[ ] = “Bill”;  Char str2[] = “Gates”;  Strcat (str1, “ “);  Strcat (str1, str2);  Printf(“n%s”, str1);  }  Otuput :  Bill Gates
  • 27. 2. Copying string together :  Void main()  {  Char str1[ ]= “BCA”;  Char str2[ ]= “BBA”;  Char str3[ ];  Strcpy(str3,str1);  Strcat(str3,str2);  Printf(%s”,str3);  Output :  BCABBA
  • 28. 3.Comparing string together:  Void main()  Char city1[ ]= “Bombay”;  Char city2[ ]= “Osmanabad”;  Int i,j;  i=strcmp(city1,city2);  j=strcmp(city2,city2);  Printf(“%d”, i);  Printf(%d”,j);  } B=66 O=79 Output: -13 13
  • 29. 4.Calculating the length of string :  Void main()  {  Int I;  Char city[]= “Osmanabad”;  i=strlen(city);  Printf(“%d”,strlen(city));  }  Output:  9
  • 30. Def: A structure is a collection of different types of data types grouped together under a single name. Each variable within the structure is called a member. The name given to the structure is called structure tag.
  • 31. Syntax :  Struct tag  {  Member1;  Member2;  .  .  Membern;  };  Struct tag instance; For Ex: Struct student { Char name[20]; Int roll no; Int marks; }; Struct student s; Instance is the structure variable used to initialize the structure
  • 32. Def: A UNION is a collection of different types of data types grouped together under a single name. Each variable within the union is called a member. The name given to the union is called union tag.
  • 33. Syntax :  union tag  {  Member1;  Member2;  .  .  Membern;  };  union tag instance; For Ex: union student { Char name[20]; Int roll no; Int marks; }; unioin student s; Instance is the structure variable used to initialize the structure
  • 34. Pointer  Pointer is an important part of the c language which provide a powerful flexible way to manipulate the data.  Reason for using the pointer:  1. accessing the variable defined outside of the function.  2. more efficient in handling data tables.  3. reduce the length of the program  4. reduce the complexity  5. pointer increase the execution speed. Def: Pointer is the variable which store the address of the next variable.
  • 35. FUNCTION  A function is named- accessed by name  A function is independent-perform the task on its own  Specific task  It will return the value to the calling program. Def : A function is a self-contained block of statement that perform a specific well defined task and may return the value to the calling program.
  • 36. TYPES OF FUNCTION Library function User defined function
  • 37. 1. Library function  1.<stdio.h> = printf() & scanf()  2.<conio.h> = clrscr() & getch()  3.<math.c> = pow(), exp() & sqrt()  4.<graphic.c> = circle(), setcolor() & bar() LIBRARY FILES FUNCTIONS
  • 38. 2. User Defined Functions  For ex :  Main()  {  /* call to func1()*/  Func1();  ----  ----  /* call to func2()*/  Func2();  ----  ----  } Func1() { ----- func3(); } Func2() { ----- ----- } Func3() { ---- ---- }
  • 39. THANK YOU, VERY MUCH END