SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
Programming I
Agenda
o Why we need Software
o Choosing the appropriate programming language
o “ C “ Features
o Desktop C Vs Embedded C
o Structure of C program
o Hello, World!
o Constants & Variables
o Operators
o Control flow
Why we need Software in ES
Embedded Systems is a mixture of hardware and software.
Choosing the appropriate programming language
Programming Language Ranking
C Features
C language is an old but popular programming language , because of the
following features :
o Easier and less time consuming
o Easier to modify and update
o Codes available in function libraries
o Portable
o Efficient use of pointers
Embedded C Vs Desktop C
Embedded C is a set of extensions for the ordinary C , Developed to be used
with Embedded Systems. It has uses most of C syntax but differ from Desktop C
at the following :
o Writing low level code
o Writing in-line assembly code
Structure of C program
“Hello, World!” Program
Constants
Constant :
Constants are the terms that can't be changed during the execution of a
program. For example: 99 , 65.5 … C has 3 types of Constants.
Constants types :
o Integer Constant : like 10 , 68
o Float-point Constant : 2.9 , 3.0
o Character Constant : ‘A’ , ‘ r’ , ‘255’
Constants : Example
Variables
Variable :
Variables are memory location in computer's memory to store data. And
each location of memory has its special name.
Rules for variable names :
o Variable name can be composed of letters , digits and underscore '_' only.
o The first letter of a variable should be either a letter or an underscore.
o Note :
In C programming, you have to declare variable before using it in the
program.
Data types in C
Type Size Min Max
Char 1 Byte 0 255
Short 2 Byte 0 65,535
Int 2 Or 4 Byte 0 4,294,967,295
Long 4 Byte 0 4,294,967,295
Float 4 Byte 1.2E-38 3.4E+38
Double 8 Byte 2.3E-308 1.7E+308
Variables : Example
Operators : Arithmetic
Operator Description
+ Adds two operands
- Subtracts second operand from the first
* Multiplies both operands
/ Divides numerator by de-numerator
% Modulus Operator and remainder of after an integer
division
++ Increments operator increases integer value by one
-- Decrements operator decreases integer value by one
Operators : Relational
Operator Description
== Checks if the values of two operands are equal or not, if yes then
condition becomes true
!= Checks if the values of two operands are equal or not, if values are not
equal then condition becomes true
> Checks if the value of left operand is greater than the value of right
operand, if yes then condition becomes true
< Checks if the value of left operand is less than the value of right
operand, if yes then condition becomes true
>= Checks if the value of left operand is greater than or equal to the value
of right operand, if yes then condition becomes true
<= Checks if the value of left operand is less than or equal to the value of
right operand, if yes then condition becomes true
Operators : Logical
Operator Description
&& Called Logical AND operator. If both the operands are non-
zero, then condition becomes true
|| Called Logical OR Operator. If any of the two operands is
non-zero, then condition becomes true
! Called Logical NOT Operator. Use to reverses the logical
state of its operand. If a condition is true then Logical NOT
operator will make false
Operators : Bitwise
Operator Description
& Binary AND Operator copies a bit to the result if it exists in both
operands
| Binary OR Operator copies a bit if it exists in either operand
^ Binary XOR Operator copies the bit if it is set in one operand but not
both
~ Binary Ones Complement Operator is unary and has the effect of
'flipping' bits
<< Binary Left Shift Operator. The left operands value is moved left by the
number of bits specified by the right operand
>> Binary Right Shift Operator. The left operands value is moved right by
the number of bits specified by the right operand
Control Flow
C language has many ways to change the flow of the program for example
o If Statement
o If .. Else statement
o Switch
Q & A

Más contenido relacionado

La actualidad más candente

Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
Anil Dutt
 
C language (Collected By Dushmanta)
C language  (Collected By Dushmanta)C language  (Collected By Dushmanta)
C language (Collected By Dushmanta)
Dushmanta Nath
 

La actualidad más candente (20)

C language for Semester Exams for Engineers
C language for Semester Exams for Engineers C language for Semester Exams for Engineers
C language for Semester Exams for Engineers
 
C notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semC notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-sem
 
The smartpath information systems c pro
The smartpath information systems c proThe smartpath information systems c pro
The smartpath information systems c pro
 
C programming-apurbo datta
C programming-apurbo dattaC programming-apurbo datta
C programming-apurbo datta
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
 
C language basics
C language basicsC language basics
C language basics
 
C programming language
C programming languageC programming language
C programming language
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
C programming
C programmingC programming
C programming
 
C Programming
C ProgrammingC Programming
C Programming
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)
 
Overview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiOverview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya Jyothi
 
C language (Collected By Dushmanta)
C language  (Collected By Dushmanta)C language  (Collected By Dushmanta)
C language (Collected By Dushmanta)
 
Learning c - An extensive guide to learn the C Language
Learning c - An extensive guide to learn the C LanguageLearning c - An extensive guide to learn the C Language
Learning c - An extensive guide to learn the C Language
 
C program compiler presentation
C program compiler presentationC program compiler presentation
C program compiler presentation
 

Destacado

Introduction to C language
Introduction to C languageIntroduction to C language
Introduction to C language
Ketan Chaoji
 
陈式太极拳实用拳法—陈发科晚年传授技击精萃(珍藏版)
陈式太极拳实用拳法—陈发科晚年传授技击精萃(珍藏版)陈式太极拳实用拳法—陈发科晚年传授技击精萃(珍藏版)
陈式太极拳实用拳法—陈发科晚年传授技击精萃(珍藏版)
Jin Song
 
Dollar.Judith.portfolio2015.2
Dollar.Judith.portfolio2015.2Dollar.Judith.portfolio2015.2
Dollar.Judith.portfolio2015.2
Judith Dollar
 
Principles of object oriented programing
Principles of object oriented programingPrinciples of object oriented programing
Principles of object oriented programing
Ahammed Alamin
 

Destacado (16)

Introduction to C language
Introduction to C languageIntroduction to C language
Introduction to C language
 
Introduction to c language by nitesh
Introduction to c language by niteshIntroduction to c language by nitesh
Introduction to c language by nitesh
 
C programming language
C programming languageC programming language
C programming language
 
Paithan Testimonial
Paithan TestimonialPaithan Testimonial
Paithan Testimonial
 
D lang
D langD lang
D lang
 
Class1
Class1Class1
Class1
 
InDesign Product Brochure for Guardian Life Insurance
InDesign Product Brochure for Guardian Life InsuranceInDesign Product Brochure for Guardian Life Insurance
InDesign Product Brochure for Guardian Life Insurance
 
陈式太极拳实用拳法—陈发科晚年传授技击精萃(珍藏版)
陈式太极拳实用拳法—陈发科晚年传授技击精萃(珍藏版)陈式太极拳实用拳法—陈发科晚年传授技击精萃(珍藏版)
陈式太极拳实用拳法—陈发科晚年传授技击精萃(珍藏版)
 
Dollar.Judith.portfolio2015.2
Dollar.Judith.portfolio2015.2Dollar.Judith.portfolio2015.2
Dollar.Judith.portfolio2015.2
 
Portfolio (pcorey)
Portfolio (pcorey)Portfolio (pcorey)
Portfolio (pcorey)
 
sravan kumar_Wheebox Achievement_Score
sravan kumar_Wheebox Achievement_Scoresravan kumar_Wheebox Achievement_Score
sravan kumar_Wheebox Achievement_Score
 
La Opinión de Murcia
La Opinión de MurciaLa Opinión de Murcia
La Opinión de Murcia
 
Principles of object oriented programing
Principles of object oriented programingPrinciples of object oriented programing
Principles of object oriented programing
 
Parallel Programming in Python: Speeding up your analysis
Parallel Programming in Python: Speeding up your analysisParallel Programming in Python: Speeding up your analysis
Parallel Programming in Python: Speeding up your analysis
 
C++ Language
C++ LanguageC++ Language
C++ Language
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 

Similar a C language

data type.pptxddddswwyertr hai na ki extend kr de la
data type.pptxddddswwyertr hai na ki extend kr de ladata type.pptxddddswwyertr hai na ki extend kr de la
data type.pptxddddswwyertr hai na ki extend kr de la
LEOFAKE
 
Cpu-fundamental of C
Cpu-fundamental of CCpu-fundamental of C
Cpu-fundamental of C
Suchit Patel
 
2.overview of c#
2.overview of c#2.overview of c#
2.overview of c#
Raghu nath
 

Similar a C language (20)

Operators and it's type
Operators and it's type Operators and it's type
Operators and it's type
 
operator (1).pptx
operator (1).pptxoperator (1).pptx
operator (1).pptx
 
C Language Part 1
C Language Part 1C Language Part 1
C Language Part 1
 
C sharp part 001
C sharp part 001C sharp part 001
C sharp part 001
 
data type.pptxddddswwyertr hai na ki extend kr de la
data type.pptxddddswwyertr hai na ki extend kr de ladata type.pptxddddswwyertr hai na ki extend kr de la
data type.pptxddddswwyertr hai na ki extend kr de la
 
C++ chapter 2
C++ chapter 2C++ chapter 2
C++ chapter 2
 
C basics
C basicsC basics
C basics
 
C basics
C basicsC basics
C basics
 
PE1 Module 2.ppt
PE1 Module 2.pptPE1 Module 2.ppt
PE1 Module 2.ppt
 
Programming presentation
Programming presentationProgramming presentation
Programming presentation
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Cpu-fundamental of C
Cpu-fundamental of CCpu-fundamental of C
Cpu-fundamental of C
 
C++ revision add on till now
C++ revision add on till nowC++ revision add on till now
C++ revision add on till now
 
C++ revision add on till now
C++ revision add on till nowC++ revision add on till now
C++ revision add on till now
 
Basic commands in C++
Basic commands in C++Basic commands in C++
Basic commands in C++
 
2.overview of c#
2.overview of c#2.overview of c#
2.overview of c#
 
Chapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B KuteChapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B Kute
 
#Code2 create c++ for beginners
#Code2 create  c++ for beginners #Code2 create  c++ for beginners
#Code2 create c++ for beginners
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
 

Último

+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
Health
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 

Último (20)

A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptx
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 

C language

  • 2. Agenda o Why we need Software o Choosing the appropriate programming language o “ C “ Features o Desktop C Vs Embedded C o Structure of C program o Hello, World! o Constants & Variables o Operators o Control flow
  • 3. Why we need Software in ES Embedded Systems is a mixture of hardware and software.
  • 4. Choosing the appropriate programming language
  • 6. C Features C language is an old but popular programming language , because of the following features : o Easier and less time consuming o Easier to modify and update o Codes available in function libraries o Portable o Efficient use of pointers
  • 7. Embedded C Vs Desktop C Embedded C is a set of extensions for the ordinary C , Developed to be used with Embedded Systems. It has uses most of C syntax but differ from Desktop C at the following : o Writing low level code o Writing in-line assembly code
  • 8. Structure of C program
  • 10. Constants Constant : Constants are the terms that can't be changed during the execution of a program. For example: 99 , 65.5 … C has 3 types of Constants. Constants types : o Integer Constant : like 10 , 68 o Float-point Constant : 2.9 , 3.0 o Character Constant : ‘A’ , ‘ r’ , ‘255’
  • 12. Variables Variable : Variables are memory location in computer's memory to store data. And each location of memory has its special name. Rules for variable names : o Variable name can be composed of letters , digits and underscore '_' only. o The first letter of a variable should be either a letter or an underscore. o Note : In C programming, you have to declare variable before using it in the program.
  • 13. Data types in C Type Size Min Max Char 1 Byte 0 255 Short 2 Byte 0 65,535 Int 2 Or 4 Byte 0 4,294,967,295 Long 4 Byte 0 4,294,967,295 Float 4 Byte 1.2E-38 3.4E+38 Double 8 Byte 2.3E-308 1.7E+308
  • 15. Operators : Arithmetic Operator Description + Adds two operands - Subtracts second operand from the first * Multiplies both operands / Divides numerator by de-numerator % Modulus Operator and remainder of after an integer division ++ Increments operator increases integer value by one -- Decrements operator decreases integer value by one
  • 16. Operators : Relational Operator Description == Checks if the values of two operands are equal or not, if yes then condition becomes true != Checks if the values of two operands are equal or not, if values are not equal then condition becomes true > Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true < Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true >= Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true <= Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true
  • 17. Operators : Logical Operator Description && Called Logical AND operator. If both the operands are non- zero, then condition becomes true || Called Logical OR Operator. If any of the two operands is non-zero, then condition becomes true ! Called Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true then Logical NOT operator will make false
  • 18. Operators : Bitwise Operator Description & Binary AND Operator copies a bit to the result if it exists in both operands | Binary OR Operator copies a bit if it exists in either operand ^ Binary XOR Operator copies the bit if it is set in one operand but not both ~ Binary Ones Complement Operator is unary and has the effect of 'flipping' bits << Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand >> Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand
  • 19. Control Flow C language has many ways to change the flow of the program for example o If Statement o If .. Else statement o Switch
  • 20. Q & A