SlideShare uma empresa Scribd logo
1 de 19
 What is “C” ?
 Feature of “C” Program
 “C” Keywords
 “C” Character Set
 Rules for Writing, Compiling & Executing
“C” Program
 Data types & Placeholders
 Control characters
 Receiving input values from keyboard
 Basic “C” Program example
 References
 “C” is a programming language developed at AT
&T’s Bell Laboratories of USA in 1972 by
Dennis Ritchie.
 Any programming language can be divided into
2 categories:
 Problem oriented (HLL)
 Machine oriented (LLL)
 But “C” is considered as Middle Level
Language.
 “C” is modular, portable, reusable.
 General purpose language
 Limited no. of keyword
 Code Re-usability & Ability to customize and
extend
 Portability
 Structured language
 Make it ideal language for system
programming.
 It can also be used for business & scientific
application.
 ANSI established a standard for “C” in 1983.
 The ability of “C” is to manipulate bits, byte &
addresses.
 It is adopted in later 1990.
 It has ability to divide & hide all the
information & instruction.
 Code can be partitioned in “C” using
functions or code block.
 C is a well structured language compare to
other.
 Portability is the ability to port or use the
software written.
 One computer C program can be reused.
 By modification or no modification.
 A programmer can easily create his own
function.
 It can be used repeatedly in different
application.
 “C” program basically collection of function.
 The function are supported by “C” library.
 Function can be added to “C” library
continuously.
 There are only 32 keywords in ”C”.
 27 keywords are given by Ritchie.
 5 is added by ANSI.
 The strength of “C” lies in its in-built function.
 Unix system provides as large number of “C”
function.
 Some function are used in operation.
 Other are for specialized in their application.
 Keywords are the
words whose
meaning has
already been
explained to the C
compiler.
 There are only 32
keywords available
in C.
 The keywords are
also called
‘Reserved words’.
 A character denotes any alphabet, digit or
special symbol used to represent
information.
 Following are the valid alphabets, numbers
and special symbols allowed in C:
 Alphabets - A, B, ….., Y, Z a, b, ……, y, z
 Digits - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
 Special symbols - ~ ‘ ! @ # % ^ & * ( ) _ - +
= |  { } [ ] : ; " ' < > , . ? /
 C is case sensitive means variable named "COUNTER" is different from
a variable named "counter".
 All keywords are lowercased.
 Keywords cannot be used for any other purpose (like variable names).
 Every C statement must end with a ”;”. Thus “;” acts as a statement
terminator.
 First character must be an alphabet or underscore, no special symbol
other than an underscore, no commas or blank spaces are allowed with
in a variable, constant or keyword.
 Blank spaces may be inserted between two words to improve the
readability of the statement. However, no blank spaces are allowed
within a variable, constant or keyword.
 Variable must be declared before it is used in the program.
 File should be have the extension .c
 Program need to be compiled before execution.
 Data type defines a set
of values that a variable
can store along with a
set of operations that
can be performed on it.
 Common data types are:
 int - integer
 char - character
 long - long integer
 float - float number
 double - long float
 a - Bell
 n - New line
 r - Carriage return
 b - Backspace
 f - Form feed
 t - Horizontal tab
 " - Quotation mark
 v - Vertical tab
 ' - Apostrophe
  - Backslash
 ? - Question mark
 0 - Null
 scanf function used to receiving input from user.
 Format string contains placeholders for variables that we
intend to receive from user.
 A”&” sign comes before each variable name that comes in
variable listing.
Note: You are not allowed to insert any additional characters in
format string other than placeholders and some special
characters. Entering even a space or other undesired
character will cause your program to work incorrectly and
the results will be unexpected. So make sure you just insert
placeholder characters in scanf format string.
 Kanetkar, P.Y. “Let Us C” Seventh Edition
2007, pp. 34-37, BPB Publications, New
Delhi-1.
 Sharan, B. V. and Jagdeesh, G. “Computer
Fundamentals And programming in C” First
Edition 2004, pp. 07-16 SMT. Sumitra
Handa, SatyaPrakashans, New Delhi.
Introduction to C Programming

Mais conteúdo relacionado

Mais procurados (19)

Introduction to C Programming - I
Introduction to C Programming - I Introduction to C Programming - I
Introduction to C Programming - I
 
Programming in c
Programming in cProgramming in c
Programming in c
 
C languaGE UNIT-1
C languaGE UNIT-1C languaGE UNIT-1
C languaGE UNIT-1
 
C tutorial
C tutorialC tutorial
C tutorial
 
C LANGUAGE NOTES
C LANGUAGE NOTESC LANGUAGE NOTES
C LANGUAGE NOTES
 
Chapter3
Chapter3Chapter3
Chapter3
 
C notes
C notesC notes
C notes
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
C tokens
C tokensC tokens
C tokens
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
 
Features of c
Features of cFeatures of c
Features of c
 
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
C notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit orderC notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit order
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
 
C language
C languageC language
C language
 
C programming
C programmingC programming
C programming
 
C programming language Reference Note
C programming language Reference NoteC programming language Reference Note
C programming language Reference Note
 
Programming in C- Introduction
Programming in C- IntroductionProgramming in C- Introduction
Programming in C- Introduction
 
C programming languag for cse students
C programming languag for cse studentsC programming languag for cse students
C programming languag for cse students
 
Javascript by Yahoo
Javascript by YahooJavascript by Yahoo
Javascript by Yahoo
 
Overview of c#
Overview of c#Overview of c#
Overview of c#
 

Semelhante a Introduction to C Programming

Semelhante a Introduction to C Programming (20)

Unit 2 introduction to c programming
Unit 2   introduction to c programmingUnit 2   introduction to c programming
Unit 2 introduction to c programming
 
C language ppt
C language pptC language ppt
C language ppt
 
UNIT 1 NOTES.docx
UNIT 1 NOTES.docxUNIT 1 NOTES.docx
UNIT 1 NOTES.docx
 
Lecture 01 2017
Lecture 01 2017Lecture 01 2017
Lecture 01 2017
 
history of c.ppt
history of c.ppthistory of c.ppt
history of c.ppt
 
C programming.pdf
C programming.pdfC programming.pdf
C programming.pdf
 
Cnotes
CnotesCnotes
Cnotes
 
C Lang notes.ppt
C Lang notes.pptC Lang notes.ppt
C Lang notes.ppt
 
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
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
C PROGRAMMING LANGUAGE.pptx
 C PROGRAMMING LANGUAGE.pptx C PROGRAMMING LANGUAGE.pptx
C PROGRAMMING LANGUAGE.pptx
 
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
 
Aniket tore
Aniket toreAniket tore
Aniket tore
 
Chapter 3(1)
Chapter 3(1)Chapter 3(1)
Chapter 3(1)
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptx
 
Msc prev updated
Msc prev updatedMsc prev updated
Msc prev updated
 
Msc prev completed
Msc prev completedMsc prev completed
Msc prev completed
 
unit2.pptx
unit2.pptxunit2.pptx
unit2.pptx
 
C presentation book
C presentation bookC presentation book
C presentation book
 
SPC Unit 2
SPC Unit 2SPC Unit 2
SPC Unit 2
 

Último

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Último (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Introduction to C Programming

  • 1.
  • 2.  What is “C” ?  Feature of “C” Program  “C” Keywords  “C” Character Set  Rules for Writing, Compiling & Executing “C” Program  Data types & Placeholders  Control characters  Receiving input values from keyboard  Basic “C” Program example  References
  • 3.  “C” is a programming language developed at AT &T’s Bell Laboratories of USA in 1972 by Dennis Ritchie.  Any programming language can be divided into 2 categories:  Problem oriented (HLL)  Machine oriented (LLL)  But “C” is considered as Middle Level Language.  “C” is modular, portable, reusable.
  • 4.  General purpose language  Limited no. of keyword  Code Re-usability & Ability to customize and extend  Portability  Structured language
  • 5.  Make it ideal language for system programming.  It can also be used for business & scientific application.  ANSI established a standard for “C” in 1983.  The ability of “C” is to manipulate bits, byte & addresses.  It is adopted in later 1990.
  • 6.  It has ability to divide & hide all the information & instruction.  Code can be partitioned in “C” using functions or code block.  C is a well structured language compare to other.
  • 7.  Portability is the ability to port or use the software written.  One computer C program can be reused.  By modification or no modification.
  • 8.  A programmer can easily create his own function.  It can be used repeatedly in different application.  “C” program basically collection of function.  The function are supported by “C” library.  Function can be added to “C” library continuously.
  • 9.  There are only 32 keywords in ”C”.  27 keywords are given by Ritchie.  5 is added by ANSI.  The strength of “C” lies in its in-built function.  Unix system provides as large number of “C” function.  Some function are used in operation.  Other are for specialized in their application.
  • 10.  Keywords are the words whose meaning has already been explained to the C compiler.  There are only 32 keywords available in C.  The keywords are also called ‘Reserved words’.
  • 11.  A character denotes any alphabet, digit or special symbol used to represent information.  Following are the valid alphabets, numbers and special symbols allowed in C:  Alphabets - A, B, ….., Y, Z a, b, ……, y, z  Digits - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9  Special symbols - ~ ‘ ! @ # % ^ & * ( ) _ - + = | { } [ ] : ; " ' < > , . ? /
  • 12.  C is case sensitive means variable named "COUNTER" is different from a variable named "counter".  All keywords are lowercased.  Keywords cannot be used for any other purpose (like variable names).  Every C statement must end with a ”;”. Thus “;” acts as a statement terminator.  First character must be an alphabet or underscore, no special symbol other than an underscore, no commas or blank spaces are allowed with in a variable, constant or keyword.  Blank spaces may be inserted between two words to improve the readability of the statement. However, no blank spaces are allowed within a variable, constant or keyword.  Variable must be declared before it is used in the program.  File should be have the extension .c  Program need to be compiled before execution.
  • 13.  Data type defines a set of values that a variable can store along with a set of operations that can be performed on it.  Common data types are:  int - integer  char - character  long - long integer  float - float number  double - long float
  • 14.  a - Bell  n - New line  r - Carriage return  b - Backspace  f - Form feed  t - Horizontal tab  " - Quotation mark  v - Vertical tab  ' - Apostrophe  - Backslash  ? - Question mark  0 - Null
  • 15.  scanf function used to receiving input from user.  Format string contains placeholders for variables that we intend to receive from user.  A”&” sign comes before each variable name that comes in variable listing. Note: You are not allowed to insert any additional characters in format string other than placeholders and some special characters. Entering even a space or other undesired character will cause your program to work incorrectly and the results will be unexpected. So make sure you just insert placeholder characters in scanf format string.
  • 16.
  • 17.
  • 18.  Kanetkar, P.Y. “Let Us C” Seventh Edition 2007, pp. 34-37, BPB Publications, New Delhi-1.  Sharan, B. V. and Jagdeesh, G. “Computer Fundamentals And programming in C” First Edition 2004, pp. 07-16 SMT. Sumitra Handa, SatyaPrakashans, New Delhi.