SlideShare a Scribd company logo
C Programming Course Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Why teach C? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Some programmer jargon ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
More about Hello World Preprocessor Library command main() means “start here” Comments are good Return 0 from main means our program finished without errors Brackets define code blocks
C doesn’t care much about spaces Both of these programs are exactly the same as the original as far as your compiler is concerned. Note that words have to be kept together and so do things in quotes. In the next lecture we'll learn how we SHOULD lay out our C program to make them look nice
 
Keywords of C ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Types of variable ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Naming variables ,[object Object],[object Object],[object Object],[object Object],int a,b; double d; /* This is a bit cryptic */ int start_time; int no_students; double course_mark; /* This is a bit better */
The  char  type ,[object Object],[object Object],[object Object],[object Object],int main() { char a, b; a= 'x';  /* Set a to the character x */ printf ("a is %c",a); b= ''; /* This really is one character*/ printf ("b is %c",b); return 0; }
More types: Signed/unsigned, long, short, const ,[object Object],[object Object],[object Object],short int small_no;  unsigned char uchar; long double precise_number; short float not_so_precise; const short float pi= 3.14; const long double e= 2.718281828;
A short note about  ++ ,[object Object],[object Object],int i= 6; printf ("%d",i++);  /* Prints 6 sets i to 7 */ int i= 6; printf ("%d",++i);  /* prints 7 and sets i to 7 */ Note this important difference It is easy to confuse yourself and others with the difference  between  ++i  and  i++  - it is best to use them only in simple ways. All of the above also applies to  -- .
Some simple operations for variables ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Casting between variables ,[object Object],[object Object],int a= 3; int b= 4; double c; c= (double)a/(double)b; By using  ( type )  in front of a variable we tell the variable to act like another type of variable.  We can cast between any type.  Usually, however, the only reason to cast is to stop ints being rounded by division. Cast ints a and b to be doubles
What is a function? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
An example function Prototype the function Call the function The function itself function header
Functions can access other functions ,[object Object]
void  functions ,[object Object],Prototype (at top of file remember) void odd_or_even (int); Function takes and returns void (no arguments) Function which takes one int arguments and returns none Another prototype
Notes about functions ,[object Object],[object Object],[object Object],[object Object]
Where do functions go in the program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What are these prototype things? ,[object Object],[object Object],[object Object],[object Object]
What is scope? ,[object Object],[object Object],[object Object],[object Object],[object Object]
The print stars example This program prints five rows of five stars This prints 'n' stars and then a new line character Loop around 5 times to  print the stars ***** ***** ***** ***** ***** Variables here are LOCAL variables
Why global is bad This program only prints ONE row of five stars Variable here is global variable
Thinking like the computer for debugging  ,[object Object],[object Object],[object Object],[object Object]
Factorial program (and thoughts) int main() { int number= 4; int answer; int count; answer= 1; count= number; while (count >= 0) { answer= answer* count; count--; } printf ("%d! = %d", number,answer); return 0; } number= 4 answer= 1 count= 4 enter while loop answer= 1*4=4 count=3 enter while loop answer=4*3= 12 count=2 enter while loop answer=12*2= 24 count= 1 enter while loop answer= 24*1= 24 count= 0 enter while loop answer= 24*0= 0 AHA – I see!!!
Other techniques for debugging ,[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

What is c
What is cWhat is c
What is c
Nitesh Saitwal
 
Lecture 9- Control Structures 1
Lecture 9- Control Structures 1Lecture 9- Control Structures 1
Lecture 9- Control Structures 1
Md. Imran Hossain Showrov
 
Lecture 11 - Functions
Lecture 11 - FunctionsLecture 11 - Functions
Lecture 11 - Functions
Md. Imran Hossain Showrov
 
7 functions
7  functions7  functions
7 functions
MomenMostafa
 
Lecture 10 - Control Structures 2
Lecture 10 - Control Structures 2Lecture 10 - Control Structures 2
Lecture 10 - Control Structures 2
Md. Imran Hossain Showrov
 
C Programming Tutorial - www.infomtec.com
C Programming Tutorial - www.infomtec.comC Programming Tutorial - www.infomtec.com
C Programming Tutorial - www.infomtec.com
M-TEC Computer Education
 
Void pointer in c
Void pointer in cVoid pointer in c
Void pointer in c
SANDIP MORADIYA
 
4 operators, expressions & statements
4  operators, expressions & statements4  operators, expressions & statements
4 operators, expressions & statements
MomenMostafa
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
Mohammed Saleh
 
Assignment12
Assignment12Assignment12
Assignment12
Sunita Milind Dol
 
Operators and Control Statements in Python
Operators and Control Statements in PythonOperators and Control Statements in Python
Operators and Control Statements in Python
RajeswariA8
 
Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]
Abhishek Sinha
 
Python-02| Input, Output & Import
Python-02| Input, Output & ImportPython-02| Input, Output & Import
Python-02| Input, Output & Import
Mohd Sajjad
 
Python Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and FunctionsPython Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and Functions
DhivyaSubramaniyam
 
Unit ii ppt
Unit ii pptUnit ii ppt
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
JavvajiVenkat
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’eShikshak
 
C language basics
C language basicsC language basics
C language basics
Milind Deshkar
 
CPU INPUT OUTPUT
CPU INPUT OUTPUT CPU INPUT OUTPUT
CPU INPUT OUTPUT
Aditya Vaishampayan
 

What's hot (20)

What is c
What is cWhat is c
What is c
 
Lecture 9- Control Structures 1
Lecture 9- Control Structures 1Lecture 9- Control Structures 1
Lecture 9- Control Structures 1
 
Lecture 11 - Functions
Lecture 11 - FunctionsLecture 11 - Functions
Lecture 11 - Functions
 
7 functions
7  functions7  functions
7 functions
 
Lecture 10 - Control Structures 2
Lecture 10 - Control Structures 2Lecture 10 - Control Structures 2
Lecture 10 - Control Structures 2
 
C Programming Tutorial - www.infomtec.com
C Programming Tutorial - www.infomtec.comC Programming Tutorial - www.infomtec.com
C Programming Tutorial - www.infomtec.com
 
Void pointer in c
Void pointer in cVoid pointer in c
Void pointer in c
 
4 operators, expressions & statements
4  operators, expressions & statements4  operators, expressions & statements
4 operators, expressions & statements
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
 
Input And Output
 Input And Output Input And Output
Input And Output
 
Assignment12
Assignment12Assignment12
Assignment12
 
Operators and Control Statements in Python
Operators and Control Statements in PythonOperators and Control Statements in Python
Operators and Control Statements in Python
 
Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]
 
Python-02| Input, Output & Import
Python-02| Input, Output & ImportPython-02| Input, Output & Import
Python-02| Input, Output & Import
 
Python Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and FunctionsPython Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and Functions
 
Unit ii ppt
Unit ii pptUnit ii ppt
Unit ii ppt
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
 
C language basics
C language basicsC language basics
C language basics
 
CPU INPUT OUTPUT
CPU INPUT OUTPUT CPU INPUT OUTPUT
CPU INPUT OUTPUT
 

Viewers also liked

what professional job is like
what professional job is likewhat professional job is like
what professional job is like
jefferyshiau
 
REAP WHAT YOU SOW
REAP WHAT YOU SOWREAP WHAT YOU SOW
REAP WHAT YOU SOWdebzters
 
omgaan met auteursrecht in het moderne onderwijs train-de-trainer iScholengroep
omgaan met auteursrecht in het moderne onderwijs train-de-trainer iScholengroepomgaan met auteursrecht in het moderne onderwijs train-de-trainer iScholengroep
omgaan met auteursrecht in het moderne onderwijs train-de-trainer iScholengroep
Kennisland
 
Co quan cam giac p1 (anh)
Co quan cam giac p1 (anh)Co quan cam giac p1 (anh)
Co quan cam giac p1 (anh)Pham Ngoc Quang
 
Chuong 6 stress thich nghi
Chuong 6 stress   thich nghiChuong 6 stress   thich nghi
Chuong 6 stress thich nghiPham Ngoc Quang
 
Safari 2011 team abc onderwijsadviseurs
Safari 2011   team abc onderwijsadviseursSafari 2011   team abc onderwijsadviseurs
Safari 2011 team abc onderwijsadviseursKennisland
 
Baraka blues aesthetic
Baraka blues aestheticBaraka blues aesthetic
Baraka blues aestheticTeresa Levy
 
AP US Museum Presentation 1960s
AP US Museum Presentation 1960sAP US Museum Presentation 1960s
AP US Museum Presentation 1960scrazy4football3
 
TANET - Luat thue TNDN - 07.2010
TANET - Luat thue TNDN -  07.2010TANET - Luat thue TNDN -  07.2010
TANET - Luat thue TNDN - 07.2010
Pham Ngoc Quang
 
Bet youdon'tknowreading
Bet youdon'tknowreadingBet youdon'tknowreading
Bet youdon'tknowreading
Monica Campana
 
Ocd masterclass 2014_terugkomdag_impactmeting
Ocd masterclass 2014_terugkomdag_impactmetingOcd masterclass 2014_terugkomdag_impactmeting
Ocd masterclass 2014_terugkomdag_impactmeting
Kennisland
 
Case Sara Zoekt Werk
Case Sara Zoekt WerkCase Sara Zoekt Werk
Case Sara Zoekt Werk
Sara Van de Velde
 
Anarcho multiculturalism and_education (1)
Anarcho multiculturalism and_education (1)Anarcho multiculturalism and_education (1)
Anarcho multiculturalism and_education (1)Teresa Levy
 
Summit keynote Anna Maybank
Summit keynote Anna MaybankSummit keynote Anna Maybank
Summit keynote Anna MaybankKennisland
 
Tackling the Talent Challenge
Tackling the Talent ChallengeTackling the Talent Challenge
Tackling the Talent Challenge
David Fletcher
 
Business continuity for Information Systems
Business continuity for Information SystemsBusiness continuity for Information Systems
Business continuity for Information Systems
David Fletcher
 

Viewers also liked (20)

what professional job is like
what professional job is likewhat professional job is like
what professional job is like
 
REAP WHAT YOU SOW
REAP WHAT YOU SOWREAP WHAT YOU SOW
REAP WHAT YOU SOW
 
omgaan met auteursrecht in het moderne onderwijs train-de-trainer iScholengroep
omgaan met auteursrecht in het moderne onderwijs train-de-trainer iScholengroepomgaan met auteursrecht in het moderne onderwijs train-de-trainer iScholengroep
omgaan met auteursrecht in het moderne onderwijs train-de-trainer iScholengroep
 
Pavlov
PavlovPavlov
Pavlov
 
Nhap mon sinh hoc 1
Nhap mon sinh hoc 1Nhap mon sinh hoc 1
Nhap mon sinh hoc 1
 
Co quan cam giac p1 (anh)
Co quan cam giac p1 (anh)Co quan cam giac p1 (anh)
Co quan cam giac p1 (anh)
 
Chuong 6 stress thich nghi
Chuong 6 stress   thich nghiChuong 6 stress   thich nghi
Chuong 6 stress thich nghi
 
Safari 2011 team abc onderwijsadviseurs
Safari 2011   team abc onderwijsadviseursSafari 2011   team abc onderwijsadviseurs
Safari 2011 team abc onderwijsadviseurs
 
Baraka blues aesthetic
Baraka blues aestheticBaraka blues aesthetic
Baraka blues aesthetic
 
AP US Museum Presentation 1960s
AP US Museum Presentation 1960sAP US Museum Presentation 1960s
AP US Museum Presentation 1960s
 
TANET - Luat thue TNDN - 07.2010
TANET - Luat thue TNDN -  07.2010TANET - Luat thue TNDN -  07.2010
TANET - Luat thue TNDN - 07.2010
 
Bet youdon'tknowreading
Bet youdon'tknowreadingBet youdon'tknowreading
Bet youdon'tknowreading
 
Ocd masterclass 2014_terugkomdag_impactmeting
Ocd masterclass 2014_terugkomdag_impactmetingOcd masterclass 2014_terugkomdag_impactmeting
Ocd masterclass 2014_terugkomdag_impactmeting
 
Case Sara Zoekt Werk
Case Sara Zoekt WerkCase Sara Zoekt Werk
Case Sara Zoekt Werk
 
Specimenprep
SpecimenprepSpecimenprep
Specimenprep
 
Anarcho multiculturalism and_education (1)
Anarcho multiculturalism and_education (1)Anarcho multiculturalism and_education (1)
Anarcho multiculturalism and_education (1)
 
Summit keynote Anna Maybank
Summit keynote Anna MaybankSummit keynote Anna Maybank
Summit keynote Anna Maybank
 
Tackling the Talent Challenge
Tackling the Talent ChallengeTackling the Talent Challenge
Tackling the Talent Challenge
 
jaredppt
jaredpptjaredppt
jaredppt
 
Business continuity for Information Systems
Business continuity for Information SystemsBusiness continuity for Information Systems
Business continuity for Information Systems
 

Similar to Lập trình C

C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
Vikram Nandini
 
C++ lecture 01
C++   lecture 01C++   lecture 01
C++ lecture 01
HNDE Labuduwa Galle
 
Presentation 2 (1).pdf
Presentation 2 (1).pdfPresentation 2 (1).pdf
Presentation 2 (1).pdf
ziyadaslanbey
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
Mahira Banu
 
Tutorial basic of c ++lesson 1 eng ver
Tutorial basic of c ++lesson 1 eng verTutorial basic of c ++lesson 1 eng ver
Tutorial basic of c ++lesson 1 eng ver
Qrembiezs Intruder
 
INDIAN INSTITUTE OF TECHNOLOGY OF KANPURESC 111M Lec03.pptx
INDIAN INSTITUTE OF TECHNOLOGY OF KANPURESC 111M Lec03.pptxINDIAN INSTITUTE OF TECHNOLOGY OF KANPURESC 111M Lec03.pptx
INDIAN INSTITUTE OF TECHNOLOGY OF KANPURESC 111M Lec03.pptx
AbhimanyuChaure
 
#Code2 create c++ for beginners
#Code2 create  c++ for beginners #Code2 create  c++ for beginners
#Code2 create c++ for beginners
GDGKuwaitGoogleDevel
 
Claguage 110226222227-phpapp02
Claguage 110226222227-phpapp02Claguage 110226222227-phpapp02
Claguage 110226222227-phpapp02
CIMAP
 
Learn C
Learn CLearn C
Learn C
kantila
 
The Sieve of Eratosthenes - Part 1
The Sieve of Eratosthenes - Part 1The Sieve of Eratosthenes - Part 1
The Sieve of Eratosthenes - Part 1
Philip Schwarz
 
The Sieve of Eratosthenes - Part 1 - with minor corrections
The Sieve of Eratosthenes - Part 1 - with minor correctionsThe Sieve of Eratosthenes - Part 1 - with minor corrections
The Sieve of Eratosthenes - Part 1 - with minor corrections
Philip Schwarz
 
Presentation 5th
Presentation 5thPresentation 5th
Presentation 5thConnex
 
Python breakdown-workbook
Python breakdown-workbookPython breakdown-workbook
Python breakdown-workbook
HARUN PEHLIVAN
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
Minh Thắng Trần
 
88 c programs 15184
88 c programs 1518488 c programs 15184
88 c programs 15184
Sumit Saini
 
C++ programming language basic to advance level
C++ programming language basic to advance levelC++ programming language basic to advance level
C++ programming language basic to advance level
sajjad ali khan
 
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
 
C programming
C programmingC programming
C programming
PralhadKhanal1
 
C programming_MSBTE_Diploma_Pranoti Doke
C programming_MSBTE_Diploma_Pranoti DokeC programming_MSBTE_Diploma_Pranoti Doke
C programming_MSBTE_Diploma_Pranoti Doke
Pranoti Doke
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
Leandro Schenone
 

Similar to Lập trình C (20)

C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
C++ lecture 01
C++   lecture 01C++   lecture 01
C++ lecture 01
 
Presentation 2 (1).pdf
Presentation 2 (1).pdfPresentation 2 (1).pdf
Presentation 2 (1).pdf
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
 
Tutorial basic of c ++lesson 1 eng ver
Tutorial basic of c ++lesson 1 eng verTutorial basic of c ++lesson 1 eng ver
Tutorial basic of c ++lesson 1 eng ver
 
INDIAN INSTITUTE OF TECHNOLOGY OF KANPURESC 111M Lec03.pptx
INDIAN INSTITUTE OF TECHNOLOGY OF KANPURESC 111M Lec03.pptxINDIAN INSTITUTE OF TECHNOLOGY OF KANPURESC 111M Lec03.pptx
INDIAN INSTITUTE OF TECHNOLOGY OF KANPURESC 111M Lec03.pptx
 
#Code2 create c++ for beginners
#Code2 create  c++ for beginners #Code2 create  c++ for beginners
#Code2 create c++ for beginners
 
Claguage 110226222227-phpapp02
Claguage 110226222227-phpapp02Claguage 110226222227-phpapp02
Claguage 110226222227-phpapp02
 
Learn C
Learn CLearn C
Learn C
 
The Sieve of Eratosthenes - Part 1
The Sieve of Eratosthenes - Part 1The Sieve of Eratosthenes - Part 1
The Sieve of Eratosthenes - Part 1
 
The Sieve of Eratosthenes - Part 1 - with minor corrections
The Sieve of Eratosthenes - Part 1 - with minor correctionsThe Sieve of Eratosthenes - Part 1 - with minor corrections
The Sieve of Eratosthenes - Part 1 - with minor corrections
 
Presentation 5th
Presentation 5thPresentation 5th
Presentation 5th
 
Python breakdown-workbook
Python breakdown-workbookPython breakdown-workbook
Python breakdown-workbook
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
 
88 c programs 15184
88 c programs 1518488 c programs 15184
88 c programs 15184
 
C++ programming language basic to advance level
C++ programming language basic to advance levelC++ programming language basic to advance level
C++ programming language basic to advance level
 
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
 
C programming
C programmingC programming
C programming
 
C programming_MSBTE_Diploma_Pranoti Doke
C programming_MSBTE_Diploma_Pranoti DokeC programming_MSBTE_Diploma_Pranoti Doke
C programming_MSBTE_Diploma_Pranoti Doke
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
 

More from Viet NguyenHoang

Thai nguyen 02-midrex
Thai nguyen 02-midrexThai nguyen 02-midrex
Thai nguyen 02-midrex
Viet NguyenHoang
 
Thai nguyen 04-corex
Thai nguyen 04-corexThai nguyen 04-corex
Thai nguyen 04-corex
Viet NguyenHoang
 
Thai nguyen 03-1-slrn
Thai nguyen 03-1-slrnThai nguyen 03-1-slrn
Thai nguyen 03-1-slrn
Viet NguyenHoang
 
Thai nguyen 01-intro-print
Thai nguyen 01-intro-printThai nguyen 01-intro-print
Thai nguyen 01-intro-print
Viet NguyenHoang
 
Lost foam cast process
Lost foam cast processLost foam cast process
Lost foam cast process
Viet NguyenHoang
 
Grain size analysis by using ImageJ
Grain size analysis by using ImageJGrain size analysis by using ImageJ
Grain size analysis by using ImageJ
Viet NguyenHoang
 
Nano Indentation Lecture2
Nano Indentation Lecture2Nano Indentation Lecture2
Nano Indentation Lecture2
Viet NguyenHoang
 
Thép
ThépThép
Open Source Presentation To Portal Partners2
Open Source Presentation To Portal Partners2Open Source Presentation To Portal Partners2
Open Source Presentation To Portal Partners2Viet NguyenHoang
 
Opensource Powerpoint Review.Ppt
Opensource Powerpoint Review.PptOpensource Powerpoint Review.Ppt
Opensource Powerpoint Review.PptViet NguyenHoang
 
Manufacturing
ManufacturingManufacturing
Manufacturing
Viet NguyenHoang
 

More from Viet NguyenHoang (20)

Thai nguyen 02-midrex
Thai nguyen 02-midrexThai nguyen 02-midrex
Thai nguyen 02-midrex
 
Thai nguyen 04-corex
Thai nguyen 04-corexThai nguyen 04-corex
Thai nguyen 04-corex
 
Thai nguyen 03-1-slrn
Thai nguyen 03-1-slrnThai nguyen 03-1-slrn
Thai nguyen 03-1-slrn
 
Thai nguyen 01-intro-print
Thai nguyen 01-intro-printThai nguyen 01-intro-print
Thai nguyen 01-intro-print
 
Lost foam cast process
Lost foam cast processLost foam cast process
Lost foam cast process
 
Grain size analysis by using ImageJ
Grain size analysis by using ImageJGrain size analysis by using ImageJ
Grain size analysis by using ImageJ
 
Tem Samp1
Tem Samp1Tem Samp1
Tem Samp1
 
Tem2
Tem2Tem2
Tem2
 
Tem1
Tem1Tem1
Tem1
 
Sin2005
Sin2005Sin2005
Sin2005
 
Nano Indentation Lecture1
Nano Indentation Lecture1Nano Indentation Lecture1
Nano Indentation Lecture1
 
Nano Indentation Lecture2
Nano Indentation Lecture2Nano Indentation Lecture2
Nano Indentation Lecture2
 
Thép
ThépThép
Thép
 
Govnet.Ppt
Govnet.PptGovnet.Ppt
Govnet.Ppt
 
Licensing,Ppt
Licensing,PptLicensing,Ppt
Licensing,Ppt
 
Open Source Presentation To Portal Partners2
Open Source Presentation To Portal Partners2Open Source Presentation To Portal Partners2
Open Source Presentation To Portal Partners2
 
Opensource Powerpoint Review.Ppt
Opensource Powerpoint Review.PptOpensource Powerpoint Review.Ppt
Opensource Powerpoint Review.Ppt
 
Manufacturing
ManufacturingManufacturing
Manufacturing
 
Nuclear Power
Nuclear PowerNuclear Power
Nuclear Power
 
Thermal Energy
Thermal EnergyThermal Energy
Thermal Energy
 

Recently uploaded

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 

Recently uploaded (20)

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 

Lập trình C

  • 1.
  • 2.
  • 3.
  • 4. More about Hello World Preprocessor Library command main() means “start here” Comments are good Return 0 from main means our program finished without errors Brackets define code blocks
  • 5. C doesn’t care much about spaces Both of these programs are exactly the same as the original as far as your compiler is concerned. Note that words have to be kept together and so do things in quotes. In the next lecture we'll learn how we SHOULD lay out our C program to make them look nice
  • 6.  
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. An example function Prototype the function Call the function The function itself function header
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23. The print stars example This program prints five rows of five stars This prints 'n' stars and then a new line character Loop around 5 times to print the stars ***** ***** ***** ***** ***** Variables here are LOCAL variables
  • 24. Why global is bad This program only prints ONE row of five stars Variable here is global variable
  • 25.
  • 26. Factorial program (and thoughts) int main() { int number= 4; int answer; int count; answer= 1; count= number; while (count >= 0) { answer= answer* count; count--; } printf ("%d! = %d", number,answer); return 0; } number= 4 answer= 1 count= 4 enter while loop answer= 1*4=4 count=3 enter while loop answer=4*3= 12 count=2 enter while loop answer=12*2= 24 count= 1 enter while loop answer= 24*1= 24 count= 0 enter while loop answer= 24*0= 0 AHA – I see!!!
  • 27.