SlideShare uma empresa Scribd logo
1 de 63
A First Book of ANSI C Fourth Edition Chapter 3 Processing and Interactive Input
Objectives ,[object Object],[object Object],[object Object],[object Object]
Objectives (continued) ,[object Object],[object Object],[object Object]
Assignment ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Assignment (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Assignment (continued) If  width  was not initialized, the computer uses the value that happens to occupy that memory space previously (compiler would probably issue a warning)
Assignment (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Implicit Type Conversions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Explicit Type Conversions (Casts) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Assignment Variations sum = sum + 10  is not an equation—it is an expression that is evaluated in two major steps
Assignment Variations (continued)
Assignment Variations (continued)
Assignment Variations (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Accumulating ,[object Object],[object Object],[object Object]
Accumulating (continued)
Accumulating (continued)
Counting ,[object Object],[object Object],[object Object],[object Object]
Counting (continued)
Counting (continued)
Counting (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Counting (continued) ,[object Object],[object Object]
Counting (continued)
Mathematical Library Functions
Mathematical Library Functions (continued) ,[object Object],[object Object],[object Object]
Mathematical Library Functions (continued)
Mathematical Library Functions (continued)
Mathematical Library Functions (continued) Argument need not be a single constant
Mathematical Library Functions (continued) ,[object Object],[object Object],[object Object]
Mathematical Library Functions (continued)
Mathematical Library Functions (continued) ,[object Object],[object Object]
Mathematical Library Functions (continued)
Interactive Input
Interactive Input (continued) ,[object Object],[object Object],[object Object]
Interactive Input (continued) ,[object Object],[object Object],[object Object]
Interactive Input (continued)
Interactive Input (continued) This statement produces a  prompt Address operator (&)
Interactive Input (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Interactive Input (continued) ,[object Object],[object Object],[object Object],[object Object]
Caution: The Phantom Newline Character
Caution: The Phantom Newline Character (continued) ,[object Object],[object Object],[object Object],[object Object]
Caution: The Phantom Newline Character (continued)
Caution: The Phantom Newline Character (continued)
A First Look at User-Input Validation
A First Look at User-Input Validation (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Formatted Output ,[object Object],[object Object],[object Object],[object Object],[object Object],Output is not aligned
Formatted Output (continued) 6 18 124 --- 148 Field width specifier
Formatted Output (continued)
Format Modifiers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Other Number Bases [Optional] ,[object Object],[object Object],[object Object]
Other Number Bases (continued)
Other Number Bases (continued) ,[object Object],[object Object],[object Object]
Other Number Bases (continued)
Symbolic Constants ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Symbolic Constants (continued) # sign is a signal to a C preprocessor
Case Study: Interactive Input
Case Study: Interactive Input (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]
Common Compiler Errors
Common Compiler Errors (continued)
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary (continued) ,[object Object],[object Object],[object Object]
Summary (continued) ,[object Object],[object Object],[object Object],[object Object]

Mais conteúdo relacionado

Mais procurados

C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
Andrew Raj
 
04 control structures 1
04 control structures 104 control structures 1
04 control structures 1
Jomel Penalba
 
Control Structures
Control StructuresControl Structures
Control Structures
Ghaffar Khan
 

Mais procurados (17)

Unit ii chapter 1 operator and expressions in c
Unit ii chapter 1 operator and expressions in cUnit ii chapter 1 operator and expressions in c
Unit ii chapter 1 operator and expressions in c
 
Ch3 Formatted Input/Output
Ch3 Formatted Input/OutputCh3 Formatted Input/Output
Ch3 Formatted Input/Output
 
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
 
Ch5 Selection Statements
Ch5 Selection StatementsCh5 Selection Statements
Ch5 Selection Statements
 
Ch7 Basic Types
Ch7 Basic TypesCh7 Basic Types
Ch7 Basic Types
 
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
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
 
Python Objects
Python ObjectsPython Objects
Python Objects
 
Unit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in CUnit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in C
 
Ch6 Loops
Ch6 LoopsCh6 Loops
Ch6 Loops
 
MATLAB programming tips 2 - Input and Output Commands
MATLAB programming tips 2 - Input and Output CommandsMATLAB programming tips 2 - Input and Output Commands
MATLAB programming tips 2 - Input and Output Commands
 
FUNDAMENTAL OF C
FUNDAMENTAL OF CFUNDAMENTAL OF C
FUNDAMENTAL OF C
 
04 control structures 1
04 control structures 104 control structures 1
04 control structures 1
 
COM1407: Program Control Structures – Decision Making & Branching
COM1407: Program Control Structures – Decision Making & BranchingCOM1407: Program Control Structures – Decision Making & Branching
COM1407: Program Control Structures – Decision Making & Branching
 
Ch8 Arrays
Ch8 ArraysCh8 Arrays
Ch8 Arrays
 
C programming part4
C programming part4C programming part4
C programming part4
 
Control Structures
Control StructuresControl Structures
Control Structures
 

Destaque

Session 6 merchandising1
Session 6 merchandising1Session 6 merchandising1
Session 6 merchandising1
Arriz San Juan
 
Ch 7 foundations of planning
Ch 7 foundations of planningCh 7 foundations of planning
Ch 7 foundations of planning
Nardin A
 
Ch 18 managing operations
Ch 18 managing operationsCh 18 managing operations
Ch 18 managing operations
Nardin A
 
Chapter 10ii 2010
Chapter 10ii 2010Chapter 10ii 2010
Chapter 10ii 2010
Nardin A
 
Ch 17 introduction to controlling
Ch 17 introduction to controllingCh 17 introduction to controlling
Ch 17 introduction to controlling
Nardin A
 
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
 

Destaque (13)

Winning markets through market
Winning markets through marketWinning markets through market
Winning markets through market
 
Summary : Rencana Kerja Pemerintah 2017 (Kesehatan)
Summary : Rencana Kerja Pemerintah 2017 (Kesehatan)Summary : Rencana Kerja Pemerintah 2017 (Kesehatan)
Summary : Rencana Kerja Pemerintah 2017 (Kesehatan)
 
10 marketing insights for tokopedia (2015)
10 marketing insights for tokopedia (2015)10 marketing insights for tokopedia (2015)
10 marketing insights for tokopedia (2015)
 
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
 
Perencanaan dan penganggaran perusahaan 1
Perencanaan dan penganggaran perusahaan 1Perencanaan dan penganggaran perusahaan 1
Perencanaan dan penganggaran perusahaan 1
 
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 ...
 

Semelhante a Ch03

C programming session 02
C programming session 02C programming session 02
C programming session 02
Dushmanta Nath
 
Csharp4 operators and_casts
Csharp4 operators and_castsCsharp4 operators and_casts
Csharp4 operators and_casts
Abed Bukhari
 

Semelhante a Ch03 (20)

C Operators and Control Structures.pptx
C Operators and Control Structures.pptxC Operators and Control Structures.pptx
C Operators and Control Structures.pptx
 
COM1407: Type Casting, Command Line Arguments and Defining Constants
COM1407: Type Casting, Command Line Arguments and Defining Constants COM1407: Type Casting, Command Line Arguments and Defining Constants
COM1407: Type Casting, Command Line Arguments and Defining Constants
 
C Operators and Control Structures.pdf
C Operators and Control Structures.pdfC Operators and Control Structures.pdf
C Operators and Control Structures.pdf
 
02a fundamental c++ types, arithmetic
02a   fundamental c++ types, arithmetic 02a   fundamental c++ types, arithmetic
02a fundamental c++ types, arithmetic
 
C programming session 02
C programming session 02C programming session 02
C programming session 02
 
[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence
[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence
[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence
 
11 functions
11 functions11 functions
11 functions
 
1. Ch_1 SL_1_Intro to Matlab.pptx
1. Ch_1 SL_1_Intro to Matlab.pptx1. Ch_1 SL_1_Intro to Matlab.pptx
1. Ch_1 SL_1_Intro to Matlab.pptx
 
Functions Practice Sheet.docx
Functions Practice Sheet.docxFunctions Practice Sheet.docx
Functions Practice Sheet.docx
 
Control Structures in C
Control Structures in CControl Structures in C
Control Structures in C
 
L03vars
L03varsL03vars
L03vars
 
Csharp4 operators and_casts
Csharp4 operators and_castsCsharp4 operators and_casts
Csharp4 operators and_casts
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4
 
Operators1.pptx
Operators1.pptxOperators1.pptx
Operators1.pptx
 
Theory3
Theory3Theory3
Theory3
 
keyword
keywordkeyword
keyword
 
keyword
keywordkeyword
keyword
 
C chap02
C chap02C chap02
C chap02
 
C chap02
C chap02C chap02
C chap02
 
C important questions
C important questionsC important questions
C important questions
 

Mais de Arriz San Juan

Mais de Arriz San Juan (12)

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
 
Ch13
Ch13Ch13
Ch13
 
Ch07
Ch07Ch07
Ch07
 

Ch03