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

More Related Content

PPT
C language Unit 2 Slides, UPTU C language
PPSX
Complete C programming Language Course
PPTX
C programming language tutorial
ODP
OpenGurukul : Language : C Programming
PPT
C the basic concepts
PPTX
Basic c programming and explanation PPT1
PPT
C program
ODP
Basic C Programming language
C language Unit 2 Slides, UPTU C language
Complete C programming Language Course
C programming language tutorial
OpenGurukul : Language : C Programming
C the basic concepts
Basic c programming and explanation PPT1
C program
Basic C Programming language

What's hot (20)

PDF
C language for Semester Exams for Engineers
DOC
C notes diploma-ee-3rd-sem
PPT
The smartpath information systems c pro
PPTX
C programming-apurbo datta
PPTX
C Programming Language Tutorial for beginners - JavaTpoint
PPT
Introduction to Basic C programming 01
PPTX
Structure of c_program_to_input_output
PPT
C language basics
PDF
C programming language
PPT
Structure of a C program
PPTX
Introduction to C programming
PDF
C Programming
PPTX
Introduction to C Programming
PPTX
C Programming Unit-1
PPTX
C Language (All Concept)
PPTX
Overview of C Mrs Sowmya Jyothi
PPSX
C language (Collected By Dushmanta)
PDF
Learning c - An extensive guide to learn the C Language
PPT
C program compiler presentation
C language for Semester Exams for Engineers
C notes diploma-ee-3rd-sem
The smartpath information systems c pro
C programming-apurbo datta
C Programming Language Tutorial for beginners - JavaTpoint
Introduction to Basic C programming 01
Structure of c_program_to_input_output
C language basics
C programming language
Structure of a C program
Introduction to C programming
C Programming
Introduction to C Programming
C Programming Unit-1
C Language (All Concept)
Overview of C Mrs Sowmya Jyothi
C language (Collected By Dushmanta)
Learning c - An extensive guide to learn the C Language
C program compiler presentation
Ad

Viewers also liked (16)

PPTX
Introduction to C language
PPT
Introduction to c language by nitesh
PPTX
C programming language
PDF
Paithan Testimonial
PDF
PDF
InDesign Product Brochure for Guardian Life Insurance
PDF
陈式太极拳实用拳法—陈发科晚年传授技击精萃(珍藏版)
PDF
Dollar.Judith.portfolio2015.2
PDF
Portfolio (pcorey)
PDF
sravan kumar_Wheebox Achievement_Score
PDF
La Opinión de Murcia
PPTX
Principles of object oriented programing
PDF
Parallel Programming in Python: Speeding up your analysis
PPS
C++ Language
PPTX
Introduction to c programming
Introduction to C language
Introduction to c language by nitesh
C programming language
Paithan Testimonial
InDesign Product Brochure for Guardian Life Insurance
陈式太极拳实用拳法—陈发科晚年传授技击精萃(珍藏版)
Dollar.Judith.portfolio2015.2
Portfolio (pcorey)
sravan kumar_Wheebox Achievement_Score
La Opinión de Murcia
Principles of object oriented programing
Parallel Programming in Python: Speeding up your analysis
C++ Language
Introduction to c programming
Ad

Similar to C language (20)

PPTX
Operators and it's type
PPTX
operator (1).pptx
PPTX
CSE113 (UNIT-2)Storage classes in the computer science.pptx
PPTX
C Language Part 1
PPTX
C sharp part 001
PDF
C++ notes.pdf BASIC C++ NOTES FOR BEGGINERS
PPTX
data type.pptxddddswwyertr hai na ki extend kr de la
PPT
C++ chapter 2
PPTX
C basics
PPTX
C basics
PPT
PE1 Module 2.ppt
PPTX
Programming presentation
PPTX
Python programming language introduction unit
PPTX
Fundamentals of computers - C Programming
PPTX
POLITEKNIK MALAYSIA
PPTX
Cpu-fundamental of C
PPTX
BCP_u2.pptxBCP_u2.pptxBCP_u2.pptxBCP_u2.pptx
PPTX
C++ revision add on till now
PPTX
C++ revision add on till now
DOCX
Basic commands in C++
Operators and it's type
operator (1).pptx
CSE113 (UNIT-2)Storage classes in the computer science.pptx
C Language Part 1
C sharp part 001
C++ notes.pdf BASIC C++ NOTES FOR BEGGINERS
data type.pptxddddswwyertr hai na ki extend kr de la
C++ chapter 2
C basics
C basics
PE1 Module 2.ppt
Programming presentation
Python programming language introduction unit
Fundamentals of computers - C Programming
POLITEKNIK MALAYSIA
Cpu-fundamental of C
BCP_u2.pptxBCP_u2.pptxBCP_u2.pptxBCP_u2.pptx
C++ revision add on till now
C++ revision add on till now
Basic commands in C++

Recently uploaded (20)

PPTX
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
PDF
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
PPTX
Current and future trends in Computer Vision.pptx
PDF
Design Guidelines and solutions for Plastics parts
PPTX
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
PPTX
Amdahl’s law is explained in the above power point presentations
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PDF
Improvement effect of pyrolyzed agro-food biochar on the properties of.pdf
PPTX
Information Storage and Retrieval Techniques Unit III
PDF
ChapteR012372321DFGDSFGDFGDFSGDFGDFGDFGSDFGDFGFD
PPTX
Software Engineering and software moduleing
PDF
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
PDF
Abrasive, erosive and cavitation wear.pdf
PDF
August 2025 - Top 10 Read Articles in Network Security & Its Applications
PPTX
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PPTX
Feature types and data preprocessing steps
PDF
737-MAX_SRG.pdf student reference guides
PPTX
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
PPTX
Fundamentals of Mechanical Engineering.pptx
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
Current and future trends in Computer Vision.pptx
Design Guidelines and solutions for Plastics parts
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
Amdahl’s law is explained in the above power point presentations
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
Improvement effect of pyrolyzed agro-food biochar on the properties of.pdf
Information Storage and Retrieval Techniques Unit III
ChapteR012372321DFGDSFGDFGDFSGDFGDFGDFGSDFGDFGFD
Software Engineering and software moduleing
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
Abrasive, erosive and cavitation wear.pdf
August 2025 - Top 10 Read Articles in Network Security & Its Applications
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
Feature types and data preprocessing steps
737-MAX_SRG.pdf student reference guides
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
Fundamentals of Mechanical Engineering.pptx

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