SlideShare ist ein Scribd-Unternehmen logo
1 von 76
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]

Weitere ähnliche Inhalte

Was ist angesagt?

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 languageRakesh Roshan
 
Overview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiOverview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiSowmya 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 JyothiSowmyaJyothi3
 
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 ALGORITHMRc Os
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to cHattori Sidek
 
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.pdfSowmyaJyothi3
 
Top Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTop Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTanzeela_Hussain
 

Was ist angesagt? (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)
 

Andere mochten auch

Ch org culrure,envioronmnet and constraints
Ch org culrure,envioronmnet and constraintsCh org culrure,envioronmnet and constraints
Ch org culrure,envioronmnet and constraintsMisbahUllah312
 
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 makersNardin A
 
Pengantar manajemen
Pengantar manajemenPengantar manajemen
Pengantar manajemenDissa 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 IntroductionNardin A
 
Ch 14 managers and communications
Ch 14 managers and communicationsCh 14 managers and communications
Ch 14 managers and communicationsNardin A
 

Andere mochten auch (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
 

Ähnlich wie Ch02

C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxLikhil181
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C ProgrammingMOHAMAD NOH AHMAD
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 FocJAYA
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)indrasir
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptxmadhurij54
 
Chapter3
Chapter3Chapter3
Chapter3Kamran
 
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.SivakumarSivakumar R D .
 
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.pptxAnkitaVerma776806
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)sachindane
 
02a fundamental c++ types, arithmetic
02a   fundamental c++ types, arithmetic 02a   fundamental c++ types, arithmetic
02a fundamental c++ types, arithmetic Manzoor ALam
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniquesvalarpink
 

Ähnlich wie Ch02 (20)

Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
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
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
 
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
 
02a fundamental c++ types, arithmetic
02a   fundamental c++ types, arithmetic 02a   fundamental c++ types, arithmetic
02a fundamental c++ types, arithmetic
 
C++ programming
C++ programmingC++ programming
C++ programming
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
 

Mehr von Arriz San Juan

Mehr von 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