SlideShare a Scribd company logo
1
Objectives
❏ To understand the structure of a C-language program.
❏ To write your first C program.
❏ To introduce the include preprocessor command.
❏ To be able to create good identifiers for objects in a program.
❏ To be able to list, describe, and use the C basic data types.
❏ To be able to create and use variables and constants.
❏ To understand input and output concepts.
❏ To be able to use simple input and output statements.
Introduction to the C Language
2
Background
C is a structured programming language. It is
considered a high-level language because it allows the
programmer to concentrate on the problem at hand
and not worry about the machine that the program
will be using. That is another reason why it is used by
software developers whose applications have to run on
many different hardware platforms.
3
C Programs
It's time to write your first C program.
Structure of a C Program
Your First C Program
Comments
The Greeting Program
Topics discussed in this section:
4
Structure of a C Program
5
The Greeting Program
6
The Greeting Program
7
Examples of Block Comments
8
Examples of Line Comments
9
Identifiers
One feature present in all computer languages is the
identifier. Identifiers allow us to name data and other
objects in the program. Each identified object in the
computer is stored at a unique address.
10
Rules for Identifiers
11
C is a case-sensitive language.
Note
12
Examples of Valid and Invalid Names
13
Data Types
14
Character Types
15
Integer Types
16
sizeof (short) ≤ sizeof (int) ≤ sizeof (long) ≤ sizeof (long long)
Note
17
Typical Integer Sizes and Values for Signed Integers
18
Floating-point Types
19
sizeof (float) ≤ sizeof (double) ≤ sizeof (long double)
Note
20
Type Summary
21
Variables
Variables are named memory locations that have a type,
such as integer or character, which is inherited from
their type. The type determines the values that a variable
may contain and the operations that may be used with
its values.
Variable Declaration
Variable Initialization
Topics discussed in this section:
22
Variables
23
Examples of Variable Declarations and Definitions
24
Variable Initialization
‘B’
25
Constants
Constants are data values that cannot be changed
during the execution of a program. Like variables,
constants have a type. In this section, we discuss
Boolean, character, integer, real, complex, and string
constants.
Constant Representation
Coding Constants
Topics discussed in this section:
26
Symbolic Names for Control Characters
27
Examples of Integer Constants
28
Examples of Real Constants
Ad

More Related Content

Similar to Semester-1-22-23-Introduction_to_c_programming.ppt (20)

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
ComedyTechnology
 
Fundamental of Programming Language UNIT-I
Fundamental of Programming Language UNIT-IFundamental of Programming Language UNIT-I
Fundamental of Programming Language UNIT-I
TruptiWable1
 
Learn To Code: Introduction to c
Learn To Code: Introduction to cLearn To Code: Introduction to c
Learn To Code: Introduction to c
SadhanaParameswaran
 
Interview Questions For C Language
Interview Questions For C Language Interview Questions For C Language
Interview Questions For C Language
Rowank2
 
Unit 2 introduction to c programming
Unit 2   introduction to c programmingUnit 2   introduction to c programming
Unit 2 introduction to c programming
Mithun DSouza
 
Interview Questions For C Language .pptx
Interview Questions For C Language .pptxInterview Questions For C Language .pptx
Interview Questions For C Language .pptx
Rowank2
 
Msc prev updated
Msc prev updatedMsc prev updated
Msc prev updated
mshoaib15
 
Msc prev completed
Msc prev completedMsc prev completed
Msc prev completed
mshoaib15
 
C LANGUAGE NOTES
C LANGUAGE NOTESC LANGUAGE NOTES
C LANGUAGE NOTES
Malikireddy Bramhananda Reddy
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
Mahfuzur Rahman
 
1. overview of c
1. overview of c1. overview of c
1. overview of c
amar kakde
 
unit 1 programming in c ztgdawte efhgfhj ewnfbshyufh fsfyshu
unit 1 programming in c ztgdawte efhgfhj ewnfbshyufh fsfyshuunit 1 programming in c ztgdawte efhgfhj ewnfbshyufh fsfyshu
unit 1 programming in c ztgdawte efhgfhj ewnfbshyufh fsfyshu
GauravRawat830030
 
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
jatin batra
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction tools
sunilchute1
 
Lecture 1 progrmming with C
Lecture 1 progrmming with C Lecture 1 progrmming with C
Lecture 1 progrmming with C
Army Public School and College -Faisal
 
over all view programming to computer
over all view programming to computer over all view programming to computer
over all view programming to computer
muniryaseen
 
SPC Unit 2
SPC Unit 2SPC Unit 2
SPC Unit 2
SIMONTHOMAS S
 
C++ Introduction to basic C++ IN THIS YOU WOULD KHOW ABOUT BASIC C++
C++ Introduction to basic C++ IN THIS YOU WOULD KHOW ABOUT BASIC C++C++ Introduction to basic C++ IN THIS YOU WOULD KHOW ABOUT BASIC C++
C++ Introduction to basic C++ IN THIS YOU WOULD KHOW ABOUT BASIC C++
sanatahiratoz0to9
 
introduction to programming using ANSI C
introduction to programming using ANSI Cintroduction to programming using ANSI C
introduction to programming using ANSI C
JNTUK KAKINADA
 
Unit-2_Getting Started With ‘C’ Language (3).pptx
Unit-2_Getting Started With ‘C’ Language (3).pptxUnit-2_Getting Started With ‘C’ Language (3).pptx
Unit-2_Getting Started With ‘C’ Language (3).pptx
SanketShah544615
 
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
ComedyTechnology
 
Fundamental of Programming Language UNIT-I
Fundamental of Programming Language UNIT-IFundamental of Programming Language UNIT-I
Fundamental of Programming Language UNIT-I
TruptiWable1
 
Learn To Code: Introduction to c
Learn To Code: Introduction to cLearn To Code: Introduction to c
Learn To Code: Introduction to c
SadhanaParameswaran
 
Interview Questions For C Language
Interview Questions For C Language Interview Questions For C Language
Interview Questions For C Language
Rowank2
 
Unit 2 introduction to c programming
Unit 2   introduction to c programmingUnit 2   introduction to c programming
Unit 2 introduction to c programming
Mithun DSouza
 
Interview Questions For C Language .pptx
Interview Questions For C Language .pptxInterview Questions For C Language .pptx
Interview Questions For C Language .pptx
Rowank2
 
Msc prev updated
Msc prev updatedMsc prev updated
Msc prev updated
mshoaib15
 
Msc prev completed
Msc prev completedMsc prev completed
Msc prev completed
mshoaib15
 
1. overview of c
1. overview of c1. overview of c
1. overview of c
amar kakde
 
unit 1 programming in c ztgdawte efhgfhj ewnfbshyufh fsfyshu
unit 1 programming in c ztgdawte efhgfhj ewnfbshyufh fsfyshuunit 1 programming in c ztgdawte efhgfhj ewnfbshyufh fsfyshu
unit 1 programming in c ztgdawte efhgfhj ewnfbshyufh fsfyshu
GauravRawat830030
 
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
jatin batra
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction tools
sunilchute1
 
over all view programming to computer
over all view programming to computer over all view programming to computer
over all view programming to computer
muniryaseen
 
C++ Introduction to basic C++ IN THIS YOU WOULD KHOW ABOUT BASIC C++
C++ Introduction to basic C++ IN THIS YOU WOULD KHOW ABOUT BASIC C++C++ Introduction to basic C++ IN THIS YOU WOULD KHOW ABOUT BASIC C++
C++ Introduction to basic C++ IN THIS YOU WOULD KHOW ABOUT BASIC C++
sanatahiratoz0to9
 
introduction to programming using ANSI C
introduction to programming using ANSI Cintroduction to programming using ANSI C
introduction to programming using ANSI C
JNTUK KAKINADA
 
Unit-2_Getting Started With ‘C’ Language (3).pptx
Unit-2_Getting Started With ‘C’ Language (3).pptxUnit-2_Getting Started With ‘C’ Language (3).pptx
Unit-2_Getting Started With ‘C’ Language (3).pptx
SanketShah544615
 

More from ChetanChauhan203001 (14)

final.pptx
final.pptxfinal.pptx
final.pptx
ChetanChauhan203001
 
PPT SEMINAR - Copy.pptx
 PPT SEMINAR - Copy.pptx PPT SEMINAR - Copy.pptx
PPT SEMINAR - Copy.pptx
ChetanChauhan203001
 
PPT SEMINAR -EIA.pptx
 PPT SEMINAR -EIA.pptx PPT SEMINAR -EIA.pptx
PPT SEMINAR -EIA.pptx
ChetanChauhan203001
 
CHETAN SEMINAR PPT HDI.pptx
CHETAN SEMINAR PPT HDI.pptxCHETAN SEMINAR PPT HDI.pptx
CHETAN SEMINAR PPT HDI.pptx
ChetanChauhan203001
 
ASDFGHJ.pptx
ASDFGHJ.pptxASDFGHJ.pptx
ASDFGHJ.pptx
ChetanChauhan203001
 
archana50337.pptx
archana50337.pptxarchana50337.pptx
archana50337.pptx
ChetanChauhan203001
 
Academic Search Engines.pptx
Academic Search Engines.pptxAcademic Search Engines.pptx
Academic Search Engines.pptx
ChetanChauhan203001
 
ppt on ANS.pptx
ppt on ANS.pptxppt on ANS.pptx
ppt on ANS.pptx
ChetanChauhan203001
 
CS1Lesson13-IntroClasses.pptx
CS1Lesson13-IntroClasses.pptxCS1Lesson13-IntroClasses.pptx
CS1Lesson13-IntroClasses.pptx
ChetanChauhan203001
 
consolidation-161105065728.pdf
consolidation-161105065728.pdfconsolidation-161105065728.pdf
consolidation-161105065728.pdf
ChetanChauhan203001
 
uom-2552-what-is-python-presentation.pptx
uom-2552-what-is-python-presentation.pptxuom-2552-what-is-python-presentation.pptx
uom-2552-what-is-python-presentation.pptx
ChetanChauhan203001
 
finalppt.pptx
finalppt.pptxfinalppt.pptx
finalppt.pptx
ChetanChauhan203001
 
Project Presentation 2019-2020.pptx
Project Presentation 2019-2020.pptxProject Presentation 2019-2020.pptx
Project Presentation 2019-2020.pptx
ChetanChauhan203001
 
Presentation on.pptx
Presentation on.pptxPresentation on.pptx
Presentation on.pptx
ChetanChauhan203001
 
Ad

Recently uploaded (20)

Construction-Chemicals-For-Waterproofing.ppt
Construction-Chemicals-For-Waterproofing.pptConstruction-Chemicals-For-Waterproofing.ppt
Construction-Chemicals-For-Waterproofing.ppt
ssuser2ffcbc
 
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdfML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
rameshwarchintamani
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control
 
Construction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil EngineeringConstruction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil Engineering
Lavish Kashyap
 
Using the Artificial Neural Network to Predict the Axial Strength and Strain ...
Using the Artificial Neural Network to Predict the Axial Strength and Strain ...Using the Artificial Neural Network to Predict the Axial Strength and Strain ...
Using the Artificial Neural Network to Predict the Axial Strength and Strain ...
Journal of Soft Computing in Civil Engineering
 
acid base ppt and their specific application in food
acid base ppt and their specific application in foodacid base ppt and their specific application in food
acid base ppt and their specific application in food
Fatehatun Noor
 
OPTIMIZING DATA INTEROPERABILITY IN AGILE ORGANIZATIONS: INTEGRATING NONAKA’S...
OPTIMIZING DATA INTEROPERABILITY IN AGILE ORGANIZATIONS: INTEGRATING NONAKA’S...OPTIMIZING DATA INTEROPERABILITY IN AGILE ORGANIZATIONS: INTEGRATING NONAKA’S...
OPTIMIZING DATA INTEROPERABILITY IN AGILE ORGANIZATIONS: INTEGRATING NONAKA’S...
ijdmsjournal
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink DisplayHow to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
CircuitDigest
 
Modeling the Influence of Environmental Factors on Concrete Evaporation Rate
Modeling the Influence of Environmental Factors on Concrete Evaporation RateModeling the Influence of Environmental Factors on Concrete Evaporation Rate
Modeling the Influence of Environmental Factors on Concrete Evaporation Rate
Journal of Soft Computing in Civil Engineering
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Physical and Physic-Chemical Based Optimization Methods: A Review
Physical and Physic-Chemical Based Optimization Methods: A ReviewPhysical and Physic-Chemical Based Optimization Methods: A Review
Physical and Physic-Chemical Based Optimization Methods: A Review
Journal of Soft Computing in Civil Engineering
 
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
Reflections on Morality, Philosophy, and History
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt
rakshaiya16
 
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdfLittle Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
gori42199
 
Agents chapter of Artificial intelligence
Agents chapter of Artificial intelligenceAgents chapter of Artificial intelligence
Agents chapter of Artificial intelligence
DebdeepMukherjee9
 
Construction-Chemicals-For-Waterproofing.ppt
Construction-Chemicals-For-Waterproofing.pptConstruction-Chemicals-For-Waterproofing.ppt
Construction-Chemicals-For-Waterproofing.ppt
ssuser2ffcbc
 
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdfML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
rameshwarchintamani
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
Construction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil EngineeringConstruction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil Engineering
Lavish Kashyap
 
acid base ppt and their specific application in food
acid base ppt and their specific application in foodacid base ppt and their specific application in food
acid base ppt and their specific application in food
Fatehatun Noor
 
OPTIMIZING DATA INTEROPERABILITY IN AGILE ORGANIZATIONS: INTEGRATING NONAKA’S...
OPTIMIZING DATA INTEROPERABILITY IN AGILE ORGANIZATIONS: INTEGRATING NONAKA’S...OPTIMIZING DATA INTEROPERABILITY IN AGILE ORGANIZATIONS: INTEGRATING NONAKA’S...
OPTIMIZING DATA INTEROPERABILITY IN AGILE ORGANIZATIONS: INTEGRATING NONAKA’S...
ijdmsjournal
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink DisplayHow to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
CircuitDigest
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt
rakshaiya16
 
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdfLittle Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
gori42199
 
Agents chapter of Artificial intelligence
Agents chapter of Artificial intelligenceAgents chapter of Artificial intelligence
Agents chapter of Artificial intelligence
DebdeepMukherjee9
 
Ad

Semester-1-22-23-Introduction_to_c_programming.ppt

Editor's Notes

  • #3: Developed early 1970’s
  • #15: wchar_t is a wide character:  The increased datatype size allows for the use of larger coded character sets. Width is compiler specific (not portable).
  翻译: