SlideShare a Scribd company logo
1 of 14
C PROGRAMMING
COURSE CODE:19UAKCT101
COURSE NAME : Programming in C
UNIT 1
overview of c-history of c-importance of c- constants,
variables-character set-C Tokens-Key words and
Identifiers-Constants and variables-Data types
Managing Input and Output Operations-Reading a
Character-Writing a Character-Formatted Input-
Formatted Output-operators and expressions.
C PROGRAMMING
• C is a general-purpose, high-level language that was originally
developed by Dennis M. Ritchie to develop the UNIX operating
system at Bell Labs. C was originally first implemented on the DEC
PDP-11 computer in 1972.
• In 1978, Brian Kernighan and Dennis Ritchie produced the first
publicly available description of C, now known as the K&R standard.
• The UNIX operating system, the C compiler, and essentially all
UNIX application programs have been written in C. C has now
become a widely used professional language for various reasons −
• Easy to learn
• Structured language
• It produces efficient programs
• It can handle low-level activities
• It can be compiled on a variety of computer platforms
C PROGRAMMING
• Facts about C
• C was invented to write an operating system called UNIX.
• C is a successor of B language which was introduced around
the early 1970s.
• The language was formalized in 1988 by the American
National Standard Institute (ANSI).
• The UNIX OS was totally written in C.
• Today C is the most widely used and popular System
Programming Language.
• Most of the state-of-the-art software have been implemented
using C.
• Today's most popular Linux OS and RDBMS MySQL have
been written in C.
C PROGRAMMING
Why use C?
C was initially used for system development work, particularly the programs
that make-up the operating system. C was adopted as a system development
language because it produces code that runs nearly as fast as the code written
in assembly language. Some examples of the use of C might be −
Operating Systems
Language Compilers
Assemblers
Text Editors
Print Spoolers
Network Drivers
Modern Programs
Databases
Language Interpreters
Utilities
C PROGRAMMING
• C Programs
• A C program can vary from 3 lines to millions of lines and
it should be written into one or more text files with
extension ".c"; for example, hello.c.
Importance of C
• Structured , high level, Machine independent language.
• It is a robust language whose rich set of built in functions
and operators can be used to write any complex
program.
• C language is suitable for writing both system software
and business package.
• Many of the c compilers available in market are written in
C.
• C are efficient and fast
• Many times faster than Basic.
• It has 32 keywords and several standard functions are
available.
Importance of C
• C is highly portable.
• Feature of C is its ability to extend itself.
• C language is well suited for structured programming
Basic Structure of C Programs
DOCUMENT SECTION
LINK SECTION
DEFINITION SECTION
GLOBAL DECLARATION SECTION
Main() Function Section
{
Declaration Part
Executable Part
}
SUBPROGRAM SECTION
FUNCTION 1,2,….N (USER DEFINED FUNCTION)
Basic Structure of C Programs
C Program can be viewed as a group of building blocks
called functions.
A function is a subroutine that may include one or more
statements designed to perform a specific task.
Documentation section consists of a set of comment
lines giving the name of the program.-name of the
program , author name
Link Section-Provides instruction to the compiler to link
functions from the system
Definition Section-Defines all symbolic constants.
Basic Structure of C Programs
• Some variables that are used in more than
one function .Such variables is called
global variables and declared on the
global declaration section that is outside of
all the functions. This section is also
declares all the user defined functions.
C PROGRAMMING
C PROGRAMMING
• Every C program must have one main() function
section
• It contains two Parts
• 1.Declaration Part
• 2.Executable Part
Declaration Part-declares all the variables used in
executable part.
There is at least on statement in the executable
part.
C PROGRAMMING
• These two parts must appear between
opening and closing braces.
• The program execution begins at the opening
brace and ends at the closing brace.
• The closing brace of the main section is the
logical end of the program.
• All statements in the declaration and
executable part end with semicolon.
C PROGRAMMING
• The sub program section contains all user
defined functions that are called in the main
function.
• User defined functions are generally placed
immediately after the main function.
• All sections ,except the main function section
may be absent when they are not required.

More Related Content

Similar to C session 1.pptx

Similar to C session 1.pptx (20)

Understanding C and its Applications.pdf
Understanding C and its Applications.pdfUnderstanding C and its Applications.pdf
Understanding C and its Applications.pdf
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Programming in C
Programming in CProgramming in C
Programming in C
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptx
 
C programming
C programmingC programming
C programming
 
Chapter 1: Introduction
Chapter 1: IntroductionChapter 1: Introduction
Chapter 1: Introduction
 
C.pdf
C.pdfC.pdf
C.pdf
 
C language unit-1
C language unit-1C language unit-1
C language unit-1
 
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDYC LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
 
C languaGE UNIT-1
C languaGE UNIT-1C languaGE UNIT-1
C languaGE UNIT-1
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Learn C Language
Learn C LanguageLearn C Language
Learn C Language
 
CS3251-_PIC
CS3251-_PICCS3251-_PIC
CS3251-_PIC
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Unit 1.pptx
Unit 1.pptxUnit 1.pptx
Unit 1.pptx
 
C programming
C programmingC programming
C programming
 
presentation on the topic: Introduction to the C language
presentation on the topic: Introduction to the C languagepresentation on the topic: Introduction to the C language
presentation on the topic: Introduction to the C language
 
IP Lab Manual for Kerala University 3 Year UG Programme
IP Lab Manual for Kerala University 3 Year UG ProgrammeIP Lab Manual for Kerala University 3 Year UG Programme
IP Lab Manual for Kerala University 3 Year UG Programme
 
Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 10 introduction to c language (part1)Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 10 introduction to c language (part1)
 

Recently uploaded

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxLigayaBacuel1
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 

Recently uploaded (20)

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 

C session 1.pptx

  • 1. C PROGRAMMING COURSE CODE:19UAKCT101 COURSE NAME : Programming in C UNIT 1 overview of c-history of c-importance of c- constants, variables-character set-C Tokens-Key words and Identifiers-Constants and variables-Data types Managing Input and Output Operations-Reading a Character-Writing a Character-Formatted Input- Formatted Output-operators and expressions.
  • 2. C PROGRAMMING • C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. C was originally first implemented on the DEC PDP-11 computer in 1972. • In 1978, Brian Kernighan and Dennis Ritchie produced the first publicly available description of C, now known as the K&R standard. • The UNIX operating system, the C compiler, and essentially all UNIX application programs have been written in C. C has now become a widely used professional language for various reasons − • Easy to learn • Structured language • It produces efficient programs • It can handle low-level activities • It can be compiled on a variety of computer platforms
  • 3. C PROGRAMMING • Facts about C • C was invented to write an operating system called UNIX. • C is a successor of B language which was introduced around the early 1970s. • The language was formalized in 1988 by the American National Standard Institute (ANSI). • The UNIX OS was totally written in C. • Today C is the most widely used and popular System Programming Language. • Most of the state-of-the-art software have been implemented using C. • Today's most popular Linux OS and RDBMS MySQL have been written in C.
  • 4. C PROGRAMMING Why use C? C was initially used for system development work, particularly the programs that make-up the operating system. C was adopted as a system development language because it produces code that runs nearly as fast as the code written in assembly language. Some examples of the use of C might be − Operating Systems Language Compilers Assemblers Text Editors Print Spoolers Network Drivers Modern Programs Databases Language Interpreters Utilities
  • 5. C PROGRAMMING • C Programs • A C program can vary from 3 lines to millions of lines and it should be written into one or more text files with extension ".c"; for example, hello.c.
  • 6. Importance of C • Structured , high level, Machine independent language. • It is a robust language whose rich set of built in functions and operators can be used to write any complex program. • C language is suitable for writing both system software and business package. • Many of the c compilers available in market are written in C. • C are efficient and fast • Many times faster than Basic. • It has 32 keywords and several standard functions are available.
  • 7. Importance of C • C is highly portable. • Feature of C is its ability to extend itself. • C language is well suited for structured programming
  • 8. Basic Structure of C Programs DOCUMENT SECTION LINK SECTION DEFINITION SECTION GLOBAL DECLARATION SECTION Main() Function Section { Declaration Part Executable Part } SUBPROGRAM SECTION FUNCTION 1,2,….N (USER DEFINED FUNCTION)
  • 9. Basic Structure of C Programs C Program can be viewed as a group of building blocks called functions. A function is a subroutine that may include one or more statements designed to perform a specific task. Documentation section consists of a set of comment lines giving the name of the program.-name of the program , author name Link Section-Provides instruction to the compiler to link functions from the system Definition Section-Defines all symbolic constants.
  • 10. Basic Structure of C Programs • Some variables that are used in more than one function .Such variables is called global variables and declared on the global declaration section that is outside of all the functions. This section is also declares all the user defined functions.
  • 12. C PROGRAMMING • Every C program must have one main() function section • It contains two Parts • 1.Declaration Part • 2.Executable Part Declaration Part-declares all the variables used in executable part. There is at least on statement in the executable part.
  • 13. C PROGRAMMING • These two parts must appear between opening and closing braces. • The program execution begins at the opening brace and ends at the closing brace. • The closing brace of the main section is the logical end of the program. • All statements in the declaration and executable part end with semicolon.
  • 14. C PROGRAMMING • The sub program section contains all user defined functions that are called in the main function. • User defined functions are generally placed immediately after the main function. • All sections ,except the main function section may be absent when they are not required.