SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Prepared By:
Aakash Singh
C
Language
INTRODUCTION
C language was evolved from ALGOL,BCPL
and B by Dennis Ritchie at bell laboratories in
1972.
 It has been developed to re-implement the
Unix operating system. It has since become one
of the most widely used programming
languages of all time.
To ensure that C language remains standard in
1983 American National Standards Institute
approved a version of c which is also referred to
as C89.
DENNIS RITCHIE
The c standardization
committee felt that a few
features of c++ and java if
added to c it would enhance
the usefulness of language.
The result was the 1999
standard for c .This version
is usually referred to as c99.
FEATURES OF C LANGUAGE:
It is a robust language and has a rich set of built
in functions .
C provides a wide range of data types ,
operators and functions which makes its code
highly efficient and fast.
C is a compatible language and can run on all
machines right from 8088 to recent machines.
C has only 32 keywords.
C is simple to implement and is highly effective.
C supports pointers which can directly access
the address of a variable in computers memory.
C provides Modular programming: It is a logical
collection of one or more functions or modules
C provides Dynamic Allocation of Memory :
This allows to allocate memory during runtime .
C is a middle level language.
C is extensible: It continuously adds the library
functions supported by c library.
STRUCTURE OF C PROGRAM
Documentation Section
Link Section
Definition Section
Global Declaration Section
main() Function Section
{
}
Subprogram Section:
Declaration part
Executable part
Function 1
Function 2
-
-
Function n
DOCUMENTATION SECTION:
It consists of a set of comment lines giving the
name of the program, the author and other
details, which the programmer would like to use
later.
LINK SECTION:
It provides instructions to the compiler to link
functions from the system library.
We include definite predefined standard library
functions in our C program and all these different
library functions are available in standard header
files.
DEFINITION SECTION:
Definition section defines all symbolic constants
like #define PI 3.14
GLOBAL DECLARATION SECTION:
It declares Global variables.This section also
declares user defined functions.
Global variables are the variables that are used in
more than one function and are declared in global
declaration section that is outside of all the
functions.
main() function section:
Every c program must have only one main
function. It indicates the beginning of program.
If the program contains more than one main
function the compiler cannot tell which one
marks the beginning of the program.
This section contains two parts:
Declaration part:
It declares all the variables used in executable
part.
Executable part :
There is only one statement in executable
part. It consists of statements which need to be
executed.
The program execution begins at opening
brace and ends at closing brace.
All statements in declaration and executable
part must end with semicolon i.e. ;.
Subprogram Section:
It contains all the user defined functions that
are called in the main function.
They are generally placed immediately after
main function although they may appear in any
order .
COMMENTS
Comments are used in the program to improve the
readability and understanding.
Comments are not executed by the compiler, they are
ignored by the compiler.
It helps the programmers to understand the various
operations of a program and serve as an aid to debugging
and testing.
Single line comments start with// symbol and multiple line
comments are written within /*and /*.
Header files
 The files that are specified in the include
section is called as Header File.
 These are precompiled files that has some
functions defined in them.
 We can call those functions in our program
by supplying parameters.
 Header file is given an extension .h.
 C source file is given an extension .c.
Constants
 Constants in
C are the
fixed values
that do not
change
during the
execution of
a program.
Constants Examples
 Integer Constants
o Refers to sequence of digits such as decimal integer, octal integer and
hexadecimal integer.
o Some of the examples are 112, 0551, 56579u, 0X2 etc.
 Real Constants
o The floating point constants such as 0.0083, -0.78, +67.89 etc.
 Single Character Constants
o A single char const contains a single character enclosed within a pair of
single quotes[ ‘ ‘ ]. For example, ‘g’, ‘a’, ‘I’ etc.
 String Constants
o A string constant is a sequence of characters enclosed in double quotes
[ “ “]; For example, “0211”, “Stack Overflow” etc.
 AVariables is a data name that is used to store any
data value.
 Variables are used to store values that can be changed
during the program execution.
 Variables in C have the same meaning as variables in
algebra.That is, they represent some unknown, or
variable, value.
x= a+b
z+2 = 3(y-5)
 Remember that variables in algebra are represented
by a single alphabetic character.
What Are Variables in C?
 Variables in C may be given representations containing multiple
characters. But there are rules for these representations.
 Variables names in C:
 May only consist of letters, digits, and underscores
 May be as long as you like, but only the first 31 characters are
significant
 May not be a C reserved word (keyword)
 Should start with a letter or an underscore(_)
 Can contain letters, numbers or underscore.
 No other special characters are allowed including
space.
Naming Variables
 Before using a variable , you must give the
compiler some information about the
variable; i.e., you must declare it.
 The declaration statement includes the data
type of the variable.
 Example of variable declarations:
int length;
float area;
Declaring Variables
 Variables are not automatically initialized. For
example, after declaration
int sum;
the value of the variable sum can be
anything (garbage).
 Thus, it is a good practice to initialize variables
when they are declared.
 Once a value has been placed in a variable it
stays there until the program alters it.
Declaring Variables
Data Types in C
Size and Range of Data Types
TYPE SIZE (Bits) Range
Char or Signed Char 8 -128 to 127
Unsigned Char 8 0 to 255
Int or Signed int 16 -32768 to 32767
Unsigned int 16 0 to 65535
Short int or Signed short
int
8 -128 to 127
Unsigned short int 8 0 to 255
Long int or signed long int 32 -2147483648 to
2147483647
Unsigned long int 32 0 to 4294967295
Float 32 3.4 e-38 to 3.4 e+38
Double 64 1.7 e-308 to 1.7 e+308
Long Double 80 3.4 e4932 to 3.4 e+4932
C Language

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Data types in C
Data types in CData types in C
Data types in C
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programming
 
C programming presentation for university
C programming presentation for universityC programming presentation for university
C programming presentation for university
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
 
History of c
History of cHistory of c
History of c
 
c-programming
c-programmingc-programming
c-programming
 
constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in C
 
C++
C++C++
C++
 
C notes
C notesC notes
C notes
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Introduction of c programming
Introduction of c programmingIntroduction of c programming
Introduction of c programming
 
Data types
Data typesData types
Data types
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Character set in c
Character set in cCharacter set in c
Character set in c
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
C LANGUAGE NOTES
C LANGUAGE NOTESC LANGUAGE NOTES
C LANGUAGE NOTES
 
Intro to c++
Intro to c++Intro to c++
Intro to c++
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
C++ language basic
C++ language basicC++ language basic
C++ language basic
 

Andere mochten auch

Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programmingManoj Tyagi
 
Introduction to C Language
Introduction to C LanguageIntroduction to C Language
Introduction to C LanguageTarun Sharma
 
Basic Computer Programming
Basic Computer ProgrammingBasic Computer Programming
Basic Computer ProgrammingAllen de Castro
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languagesVarun Garg
 

Andere mochten auch (20)

Lecture 12: Classes and Files
Lecture 12: Classes and FilesLecture 12: Classes and Files
Lecture 12: Classes and Files
 
Computer programming concepts
Computer programming conceptsComputer programming concepts
Computer programming concepts
 
Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c language
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Introduction to C Language
Introduction to C LanguageIntroduction to C Language
Introduction to C Language
 
Basic Computer Programming
Basic Computer ProgrammingBasic Computer Programming
Basic Computer Programming
 
Computer Programming - Lecture 1
Computer Programming - Lecture 1Computer Programming - Lecture 1
Computer Programming - Lecture 1
 
Computer Programming- Lecture 10
Computer Programming- Lecture 10Computer Programming- Lecture 10
Computer Programming- Lecture 10
 
Computer Programming- Lecture 3
Computer Programming- Lecture 3Computer Programming- Lecture 3
Computer Programming- Lecture 3
 
Computer Programming- Lecture 6
Computer Programming- Lecture 6Computer Programming- Lecture 6
Computer Programming- Lecture 6
 
Computer Programming- Lecture 11
Computer Programming- Lecture 11Computer Programming- Lecture 11
Computer Programming- Lecture 11
 
Computer Programming- Lecture 8
Computer Programming- Lecture 8Computer Programming- Lecture 8
Computer Programming- Lecture 8
 
Computer Programming- Lecture 4
Computer Programming- Lecture 4Computer Programming- Lecture 4
Computer Programming- Lecture 4
 
Computer Programming - Lecture 2
Computer Programming - Lecture 2Computer Programming - Lecture 2
Computer Programming - Lecture 2
 
Computer Programming- Lecture 9
Computer Programming- Lecture 9Computer Programming- Lecture 9
Computer Programming- Lecture 9
 
Computer Programming- Lecture 7
Computer Programming- Lecture 7Computer Programming- Lecture 7
Computer Programming- Lecture 7
 
Introduction to Embedded Systems a Practical Approach
Introduction to Embedded Systems a Practical ApproachIntroduction to Embedded Systems a Practical Approach
Introduction to Embedded Systems a Practical Approach
 
Computer Programming- Lecture 5
Computer Programming- Lecture 5 Computer Programming- Lecture 5
Computer Programming- Lecture 5
 
C ppt
C pptC ppt
C ppt
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 

Ähnlich wie C Language

Ähnlich wie C Language (20)

C programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer CentreC programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer Centre
 
unit2.pptx
unit2.pptxunit2.pptx
unit2.pptx
 
history of c.ppt
history of c.ppthistory of c.ppt
history of c.ppt
 
Aniket tore
Aniket toreAniket tore
Aniket tore
 
C language ppt
C language pptC language ppt
C language ppt
 
Cnotes
CnotesCnotes
Cnotes
 
Unit 2 introduction to c programming
Unit 2   introduction to c programmingUnit 2   introduction to c programming
Unit 2 introduction to c programming
 
Unit-1 (introduction to c language).pptx
Unit-1 (introduction to c language).pptxUnit-1 (introduction to c language).pptx
Unit-1 (introduction to c language).pptx
 
Unit-2.pptx
Unit-2.pptxUnit-2.pptx
Unit-2.pptx
 
Introduction%20C.pptx
Introduction%20C.pptxIntroduction%20C.pptx
Introduction%20C.pptx
 
C programming language tutorial for beginers.pdf
C programming language tutorial for beginers.pdfC programming language tutorial for beginers.pdf
C programming language tutorial for beginers.pdf
 
fds unit1.docx
fds unit1.docxfds unit1.docx
fds unit1.docx
 
UNIT 1 NOTES.docx
UNIT 1 NOTES.docxUNIT 1 NOTES.docx
UNIT 1 NOTES.docx
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
Lecture 1 progrmming with C
Lecture 1 progrmming with C Lecture 1 progrmming with C
Lecture 1 progrmming with C
 
Copy of UNIT 2 -- Basics Of Programming.pptx
Copy of UNIT 2 -- Basics Of Programming.pptxCopy of UNIT 2 -- Basics Of Programming.pptx
Copy of UNIT 2 -- Basics Of Programming.pptx
 
490450755-Chapter-2.ppt
490450755-Chapter-2.ppt490450755-Chapter-2.ppt
490450755-Chapter-2.ppt
 
490450755-Chapter-2.ppt
490450755-Chapter-2.ppt490450755-Chapter-2.ppt
490450755-Chapter-2.ppt
 
Cp week _2.
Cp week _2.Cp week _2.
Cp week _2.
 
(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.ppt(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.ppt
 

Mehr von Aakash Singh

Industrial engineering
Industrial engineeringIndustrial engineering
Industrial engineeringAakash Singh
 
Laurent's Series & Types of Singularities
Laurent's Series & Types of SingularitiesLaurent's Series & Types of Singularities
Laurent's Series & Types of SingularitiesAakash Singh
 
Theory of Production and Costs & Cost Concepts
Theory of Production and Costs & Cost ConceptsTheory of Production and Costs & Cost Concepts
Theory of Production and Costs & Cost ConceptsAakash Singh
 
Building Materials And Construction
Building Materials And ConstructionBuilding Materials And Construction
Building Materials And ConstructionAakash Singh
 
Indeterminate Forms and L' Hospital Rule
Indeterminate Forms and L' Hospital RuleIndeterminate Forms and L' Hospital Rule
Indeterminate Forms and L' Hospital RuleAakash Singh
 
Type Conversion, Precedence and Associativity
Type Conversion, Precedence and AssociativityType Conversion, Precedence and Associativity
Type Conversion, Precedence and AssociativityAakash Singh
 

Mehr von Aakash Singh (9)

Industrial engineering
Industrial engineeringIndustrial engineering
Industrial engineering
 
Laurent's Series & Types of Singularities
Laurent's Series & Types of SingularitiesLaurent's Series & Types of Singularities
Laurent's Series & Types of Singularities
 
Theory of Production and Costs & Cost Concepts
Theory of Production and Costs & Cost ConceptsTheory of Production and Costs & Cost Concepts
Theory of Production and Costs & Cost Concepts
 
Drilling Machine
Drilling MachineDrilling Machine
Drilling Machine
 
Entropy
EntropyEntropy
Entropy
 
Resume
ResumeResume
Resume
 
Building Materials And Construction
Building Materials And ConstructionBuilding Materials And Construction
Building Materials And Construction
 
Indeterminate Forms and L' Hospital Rule
Indeterminate Forms and L' Hospital RuleIndeterminate Forms and L' Hospital Rule
Indeterminate Forms and L' Hospital Rule
 
Type Conversion, Precedence and Associativity
Type Conversion, Precedence and AssociativityType Conversion, Precedence and Associativity
Type Conversion, Precedence and Associativity
 

Kürzlich hochgeladen

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 

Kürzlich hochgeladen (20)

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 

C Language

  • 2. INTRODUCTION C language was evolved from ALGOL,BCPL and B by Dennis Ritchie at bell laboratories in 1972.  It has been developed to re-implement the Unix operating system. It has since become one of the most widely used programming languages of all time. To ensure that C language remains standard in 1983 American National Standards Institute approved a version of c which is also referred to as C89.
  • 3. DENNIS RITCHIE The c standardization committee felt that a few features of c++ and java if added to c it would enhance the usefulness of language. The result was the 1999 standard for c .This version is usually referred to as c99.
  • 4.
  • 5. FEATURES OF C LANGUAGE: It is a robust language and has a rich set of built in functions . C provides a wide range of data types , operators and functions which makes its code highly efficient and fast. C is a compatible language and can run on all machines right from 8088 to recent machines. C has only 32 keywords.
  • 6. C is simple to implement and is highly effective. C supports pointers which can directly access the address of a variable in computers memory. C provides Modular programming: It is a logical collection of one or more functions or modules C provides Dynamic Allocation of Memory : This allows to allocate memory during runtime . C is a middle level language. C is extensible: It continuously adds the library functions supported by c library.
  • 7.
  • 8. STRUCTURE OF C PROGRAM Documentation Section Link Section Definition Section Global Declaration Section main() Function Section { } Subprogram Section: Declaration part Executable part Function 1 Function 2 - - Function n
  • 9. DOCUMENTATION SECTION: It consists of a set of comment lines giving the name of the program, the author and other details, which the programmer would like to use later. LINK SECTION: It provides instructions to the compiler to link functions from the system library. We include definite predefined standard library functions in our C program and all these different library functions are available in standard header files.
  • 10. DEFINITION SECTION: Definition section defines all symbolic constants like #define PI 3.14 GLOBAL DECLARATION SECTION: It declares Global variables.This section also declares user defined functions. Global variables are the variables that are used in more than one function and are declared in global declaration section that is outside of all the functions. main() function section: Every c program must have only one main function. It indicates the beginning of program.
  • 11. If the program contains more than one main function the compiler cannot tell which one marks the beginning of the program. This section contains two parts: Declaration part: It declares all the variables used in executable part. Executable part : There is only one statement in executable part. It consists of statements which need to be executed. The program execution begins at opening brace and ends at closing brace.
  • 12. All statements in declaration and executable part must end with semicolon i.e. ;. Subprogram Section: It contains all the user defined functions that are called in the main function. They are generally placed immediately after main function although they may appear in any order .
  • 13. COMMENTS Comments are used in the program to improve the readability and understanding. Comments are not executed by the compiler, they are ignored by the compiler. It helps the programmers to understand the various operations of a program and serve as an aid to debugging and testing. Single line comments start with// symbol and multiple line comments are written within /*and /*.
  • 14. Header files  The files that are specified in the include section is called as Header File.  These are precompiled files that has some functions defined in them.  We can call those functions in our program by supplying parameters.  Header file is given an extension .h.  C source file is given an extension .c.
  • 15. Constants  Constants in C are the fixed values that do not change during the execution of a program.
  • 16. Constants Examples  Integer Constants o Refers to sequence of digits such as decimal integer, octal integer and hexadecimal integer. o Some of the examples are 112, 0551, 56579u, 0X2 etc.  Real Constants o The floating point constants such as 0.0083, -0.78, +67.89 etc.  Single Character Constants o A single char const contains a single character enclosed within a pair of single quotes[ ‘ ‘ ]. For example, ‘g’, ‘a’, ‘I’ etc.  String Constants o A string constant is a sequence of characters enclosed in double quotes [ “ “]; For example, “0211”, “Stack Overflow” etc.
  • 17.  AVariables is a data name that is used to store any data value.  Variables are used to store values that can be changed during the program execution.  Variables in C have the same meaning as variables in algebra.That is, they represent some unknown, or variable, value. x= a+b z+2 = 3(y-5)  Remember that variables in algebra are represented by a single alphabetic character. What Are Variables in C?
  • 18.  Variables in C may be given representations containing multiple characters. But there are rules for these representations.  Variables names in C:  May only consist of letters, digits, and underscores  May be as long as you like, but only the first 31 characters are significant  May not be a C reserved word (keyword)  Should start with a letter or an underscore(_)  Can contain letters, numbers or underscore.  No other special characters are allowed including space. Naming Variables
  • 19.  Before using a variable , you must give the compiler some information about the variable; i.e., you must declare it.  The declaration statement includes the data type of the variable.  Example of variable declarations: int length; float area; Declaring Variables
  • 20.  Variables are not automatically initialized. For example, after declaration int sum; the value of the variable sum can be anything (garbage).  Thus, it is a good practice to initialize variables when they are declared.  Once a value has been placed in a variable it stays there until the program alters it. Declaring Variables
  • 22. Size and Range of Data Types TYPE SIZE (Bits) Range Char or Signed Char 8 -128 to 127 Unsigned Char 8 0 to 255 Int or Signed int 16 -32768 to 32767 Unsigned int 16 0 to 65535 Short int or Signed short int 8 -128 to 127 Unsigned short int 8 0 to 255 Long int or signed long int 32 -2147483648 to 2147483647 Unsigned long int 32 0 to 4294967295 Float 32 3.4 e-38 to 3.4 e+38 Double 64 1.7 e-308 to 1.7 e+308 Long Double 80 3.4 e4932 to 3.4 e+4932