SlideShare a Scribd company logo
A First Book of ANSI C Fourth Edition Chapter 2 Getting Started in C Programming
Objectives ,[object Object],[object Object],[object Object],[object Object]
Objectives (continued) ,[object Object],[object Object],[object Object]
Introduction to C Programming
Introduction to C Programming (continued) ,[object Object],[object Object],[object Object]
Introduction to C Programming (continued)
Introduction to C Programming (continued) Identifiers
Identifiers ,[object Object],[object Object],[object Object],[object Object]
Identifiers (continued) ,[object Object],[object Object]
Identifiers (continued)
Identifiers (continued) ,[object Object],[object Object],[object Object]
Identifiers (continued)
Identifiers (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Identifiers (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The  main()  Function Sometimes referred to as a  driver function
The  main()  Function (continued) Function header line Executable statements
The  printf()  Function ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The  printf()  Function (continued) Function arguments
The  printf()  Function (continued) Comment Preprocessor command Header file Invoking or calling the  printf()  function
The  printf()  Function (continued) Output is: Computers, computers everywhere as far as I can C Newline escape sequence
Programming Style: Indentation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Programming Style: Indentation (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Programming Style: Comments ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Programming Style: Comments (continued)
Data Types ,[object Object],[object Object]
Data Types (continued)
Data Types (continued) ,[object Object],[object Object],[object Object]
Data Types (continued)
Integer Data Types
Integer Data Types (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Integer Data Types (continued)
Integer Data Types (continued)
Integer Data Types (continued)
Floating-Point Data Types ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Floating-Point Data Types (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Floating-Point Data Types (continued)
Exponential Notation ,[object Object]
Exponential Notation (continued)
Arithmetic Operations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Arithmetic Operations (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Displaying Numerical Values ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Displaying Numerical Values (continued) ,[object Object],[object Object],[object Object],[object Object]
Displaying Numerical Values (continued)
Displaying Numerical Values (continued)
Displaying Numerical Values (continued)
Expression Types ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Integer Division ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Negation ,[object Object],[object Object]
Negation (continued)
Operator Precedence and Associativity ,[object Object],[object Object],[object Object],[object Object],[object Object]
Operator Precedence and Associativity (continued) ,[object Object],[object Object],[object Object],[object Object]
Operator Precedence and Associativity (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Operator Precedence and Associativity (continued)
Variables and Declarations ,[object Object],[object Object],[object Object]
Variables and Declarations (continued)
Variables and Declarations (continued) ,[object Object],[object Object],[object Object],Assignment statements
Variables and Declarations (continued)
Declaration Statements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Declaration Statements (continued)
Declaration Statements (continued)
Declaration Statements (continued)
Declaration Statements (continued)
Declaration Statements (continued) You can omit the  f  and let the compiler convert the double precision value into a float value when the assignment is made
Selecting Variable Names ,[object Object],[object Object],[object Object],[object Object]
Selecting Variable Names (continued) ,[object Object],[object Object],[object Object]
Initialization ,[object Object],[object Object],[object Object],[object Object]
Case Study: Temperature Conversion ,[object Object]
Case Study: Temperature Conversion (continued)
Common Programming Errors ,[object Object],[object Object],[object Object],[object Object],[object Object]
Common Programming Errors (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Common Programming Errors (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Common Compiler Errors
Common Compiler Errors (continued)
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object]
Summary (continued) ,[object Object],[object Object],[object Object],[object Object]
Summary (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III TermAndrew Raj
 
C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C language
Rakesh Roshan
 
Overview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiOverview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya Jyothi
Sowmya Jyothi
 
Constants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya JyothiConstants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya Jyothi
SowmyaJyothi3
 
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHMCLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
Rc Os
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to cHattori Sidek
 
FUNDAMENTAL OF C
FUNDAMENTAL OF CFUNDAMENTAL OF C
FUNDAMENTAL OF C
KRUNAL RAVAL
 
Getting Started with C++
Getting Started with C++Getting Started with C++
Getting Started with C++
Praveen M Jigajinni
 
STRINGS IN C MRS.SOWMYA JYOTHI.pdf
STRINGS IN C MRS.SOWMYA JYOTHI.pdfSTRINGS IN C MRS.SOWMYA JYOTHI.pdf
STRINGS IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
Python Objects
Python ObjectsPython Objects
Python Objects
MuhammadBakri13
 
C material
C materialC material
C material
tarique472
 
Declaration of variables
Declaration of variablesDeclaration of variables
Declaration of variables
Maria Stella Solon
 
Conditional Statements
Conditional StatementsConditional Statements
Conditional Statements
MuhammadBakri13
 
Top Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTop Down Parsing, Predictive Parsing
Top Down Parsing, Predictive Parsing
Tanzeela_Hussain
 
C Token’s
C Token’sC Token’s
C Token’s
Tarun Sharma
 
cp Module4(1)
cp Module4(1)cp Module4(1)
cp Module4(1)
Amarjith C K
 

What's hot (19)

C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
 
C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C language
 
Overview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiOverview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya Jyothi
 
Constants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya JyothiConstants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya Jyothi
 
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHMCLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to c
 
FUNDAMENTAL OF C
FUNDAMENTAL OF CFUNDAMENTAL OF C
FUNDAMENTAL OF C
 
Getting Started with C++
Getting Started with C++Getting Started with C++
Getting Started with C++
 
STRINGS IN C MRS.SOWMYA JYOTHI.pdf
STRINGS IN C MRS.SOWMYA JYOTHI.pdfSTRINGS IN C MRS.SOWMYA JYOTHI.pdf
STRINGS IN C MRS.SOWMYA JYOTHI.pdf
 
Python Objects
Python ObjectsPython Objects
Python Objects
 
Cp module 2
Cp module 2Cp module 2
Cp module 2
 
C material
C materialC material
C material
 
Declaration of variables
Declaration of variablesDeclaration of variables
Declaration of variables
 
Ch3 repetition
Ch3 repetitionCh3 repetition
Ch3 repetition
 
Conditional Statements
Conditional StatementsConditional Statements
Conditional Statements
 
Top Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTop Down Parsing, Predictive Parsing
Top Down Parsing, Predictive Parsing
 
Ch4 functions
Ch4 functionsCh4 functions
Ch4 functions
 
C Token’s
C Token’sC Token’s
C Token’s
 
cp Module4(1)
cp Module4(1)cp Module4(1)
cp Module4(1)
 

Viewers also liked

Ch org culrure,envioronmnet and constraints
Ch org culrure,envioronmnet and constraintsCh org culrure,envioronmnet and constraints
Ch org culrure,envioronmnet and constraints
MisbahUllah312
 
Session 6 merchandising1
Session 6 merchandising1Session 6 merchandising1
Session 6 merchandising1Arriz San Juan
 
Ch 7 foundations of planning
Ch 7 foundations of planningCh 7 foundations of planning
Ch 7 foundations of planningNardin A
 
Ch 18 managing operations
Ch 18 managing operationsCh 18 managing operations
Ch 18 managing operationsNardin A
 
Chapter 10ii 2010
Chapter 10ii 2010Chapter 10ii 2010
Chapter 10ii 2010Nardin A
 
Ch 17 introduction to controlling
Ch 17 introduction to controllingCh 17 introduction to controlling
Ch 17 introduction to controllingNardin A
 
Ch 6 managers as decision makers
Ch 6 managers as decision makersCh 6 managers as decision makers
Ch 6 managers as decision makers
Nardin A
 
Pengantar manajemen
Pengantar manajemenPengantar manajemen
Pengantar manajemen
Dissa MeLina
 
Ninth edition stephen p. robbins power point presentation by mukhtar untirta ...
Ninth edition stephen p. robbins power point presentation by mukhtar untirta ...Ninth edition stephen p. robbins power point presentation by mukhtar untirta ...
Ninth edition stephen p. robbins power point presentation by mukhtar untirta ...
Bobby D'Arch
 
Chapter 1 Introduction
Chapter 1 IntroductionChapter 1 Introduction
Chapter 1 Introduction
Nardin A
 
Ch 14 managers and communications
Ch 14 managers and communicationsCh 14 managers and communications
Ch 14 managers and communicationsNardin A
 

Viewers also liked (12)

Ch13
Ch13Ch13
Ch13
 
Ch org culrure,envioronmnet and constraints
Ch org culrure,envioronmnet and constraintsCh org culrure,envioronmnet and constraints
Ch org culrure,envioronmnet and constraints
 
Session 6 merchandising1
Session 6 merchandising1Session 6 merchandising1
Session 6 merchandising1
 
Ch 7 foundations of planning
Ch 7 foundations of planningCh 7 foundations of planning
Ch 7 foundations of planning
 
Ch 18 managing operations
Ch 18 managing operationsCh 18 managing operations
Ch 18 managing operations
 
Chapter 10ii 2010
Chapter 10ii 2010Chapter 10ii 2010
Chapter 10ii 2010
 
Ch 17 introduction to controlling
Ch 17 introduction to controllingCh 17 introduction to controlling
Ch 17 introduction to controlling
 
Ch 6 managers as decision makers
Ch 6 managers as decision makersCh 6 managers as decision makers
Ch 6 managers as decision makers
 
Pengantar manajemen
Pengantar manajemenPengantar manajemen
Pengantar manajemen
 
Ninth edition stephen p. robbins power point presentation by mukhtar untirta ...
Ninth edition stephen p. robbins power point presentation by mukhtar untirta ...Ninth edition stephen p. robbins power point presentation by mukhtar untirta ...
Ninth edition stephen p. robbins power point presentation by mukhtar untirta ...
 
Chapter 1 Introduction
Chapter 1 IntroductionChapter 1 Introduction
Chapter 1 Introduction
 
Ch 14 managers and communications
Ch 14 managers and communicationsCh 14 managers and communications
Ch 14 managers and communications
 

Similar to Ch02

java or oops class not in kerala polytechnic 4rth semester nots j
java or oops class not in kerala polytechnic  4rth semester nots jjava or oops class not in kerala polytechnic  4rth semester nots j
java or oops class not in kerala polytechnic 4rth semester nots j
ishorishore
 
CProgrammingTutorial
CProgrammingTutorialCProgrammingTutorial
CProgrammingTutorial
Muthuselvam RS
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
Likhil181
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
JAYA
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
MOHAMAD NOH AHMAD
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)indrasir
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
Vikram Nandini
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptx
madhurij54
 
Chapter3
Chapter3Chapter3
Chapter3
Kamran
 
Sample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.SivakumarSample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.Sivakumar
Sivakumar R D .
 
Module 1 PCD.docx
Module 1 PCD.docxModule 1 PCD.docx
Module 1 PCD.docx
VijayKumar886687
 
Introduction%20C.pptx
Introduction%20C.pptxIntroduction%20C.pptx
Introduction%20C.pptx
20EUEE018DEEPAKM
 
the refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptxthe refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptx
AnkitaVerma776806
 
C program
C programC program
C program
AJAL A J
 
Unit 2- Module 2.pptx
Unit 2- Module 2.pptxUnit 2- Module 2.pptx
Unit 2- Module 2.pptx
simranjotsingh2908
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)
sachindane
 
C++ lecture 01
C++   lecture 01C++   lecture 01
C++ lecture 01
HNDE Labuduwa Galle
 
comp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semanticscomp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semantics
floraaluoch3
 
02a fundamental c++ types, arithmetic
02a   fundamental c++ types, arithmetic 02a   fundamental c++ types, arithmetic
02a fundamental c++ types, arithmetic
Manzoor ALam
 

Similar to Ch02 (20)

Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
java or oops class not in kerala polytechnic 4rth semester nots j
java or oops class not in kerala polytechnic  4rth semester nots jjava or oops class not in kerala polytechnic  4rth semester nots j
java or oops class not in kerala polytechnic 4rth semester nots j
 
CProgrammingTutorial
CProgrammingTutorialCProgrammingTutorial
CProgrammingTutorial
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptx
 
Chapter3
Chapter3Chapter3
Chapter3
 
Sample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.SivakumarSample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.Sivakumar
 
Module 1 PCD.docx
Module 1 PCD.docxModule 1 PCD.docx
Module 1 PCD.docx
 
Introduction%20C.pptx
Introduction%20C.pptxIntroduction%20C.pptx
Introduction%20C.pptx
 
the refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptxthe refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptx
 
C program
C programC program
C program
 
Unit 2- Module 2.pptx
Unit 2- Module 2.pptxUnit 2- Module 2.pptx
Unit 2- Module 2.pptx
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)
 
C++ lecture 01
C++   lecture 01C++   lecture 01
C++ lecture 01
 
comp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semanticscomp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semantics
 
02a fundamental c++ types, arithmetic
02a   fundamental c++ types, arithmetic 02a   fundamental c++ types, arithmetic
02a fundamental c++ types, arithmetic
 

More from Arriz San Juan

11 advance inheritance_concepts
11 advance inheritance_concepts11 advance inheritance_concepts
11 advance inheritance_conceptsArriz San Juan
 

More from Arriz San Juan (11)

9. logic gates._rr
9. logic gates._rr9. logic gates._rr
9. logic gates._rr
 
7. kirchhoff s_rules
7. kirchhoff s_rules7. kirchhoff s_rules
7. kirchhoff s_rules
 
9. transistors.rr
9. transistors.rr9. transistors.rr
9. transistors.rr
 
12 exception handling
12 exception handling12 exception handling
12 exception handling
 
12 exception handling
12 exception handling12 exception handling
12 exception handling
 
Chap 17 controlling
Chap 17 controllingChap 17 controlling
Chap 17 controlling
 
11 advance inheritance_concepts
11 advance inheritance_concepts11 advance inheritance_concepts
11 advance inheritance_concepts
 
9. transistors.rr
9. transistors.rr9. transistors.rr
9. transistors.rr
 
8. semiconductors.rr
8. semiconductors.rr8. semiconductors.rr
8. semiconductors.rr
 
7. kirchhoff s_rules
7. kirchhoff s_rules7. kirchhoff s_rules
7. kirchhoff s_rules
 
Ch07
Ch07Ch07
Ch07
 

Ch02