SlideShare a Scribd company logo
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

What's hot

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
 

What's hot (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
 

Viewers also liked

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
 

Viewers also liked (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 to 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 to 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
 

Recently uploaded

CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
Kamal Acharya
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 

Recently uploaded (20)

A case study of cinema management system project report..pdf
A case study of cinema management system project report..pdfA case study of cinema management system project report..pdf
A case study of cinema management system project report..pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker project
 
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdfA CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
 
Introduction to Casting Processes in Manufacturing
Introduction to Casting Processes in ManufacturingIntroduction to Casting Processes in Manufacturing
Introduction to Casting Processes in Manufacturing
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
 
2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWINGBRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
 
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES  INTRODUCTION UNIT-IENERGY STORAGE DEVICES  INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
 
Furniture showroom management system project.pdf
Furniture showroom management system project.pdfFurniture showroom management system project.pdf
Furniture showroom management system project.pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
ONLINE CAR SERVICING SYSTEM PROJECT REPORT.pdf
ONLINE CAR SERVICING SYSTEM PROJECT REPORT.pdfONLINE CAR SERVICING SYSTEM PROJECT REPORT.pdf
ONLINE CAR SERVICING SYSTEM PROJECT REPORT.pdf
 
shape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptxshape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptx
 
retail automation billing system ppt.pptx
retail automation billing system ppt.pptxretail automation billing system ppt.pptx
retail automation billing system ppt.pptx
 
Online resume builder management system project report.pdf
Online resume builder management system project report.pdfOnline resume builder management system project report.pdf
Online resume builder management system project report.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
KIT-601 Lecture Notes-UNIT-5.pdf Frame Works and Visualization
KIT-601 Lecture Notes-UNIT-5.pdf Frame Works and VisualizationKIT-601 Lecture Notes-UNIT-5.pdf Frame Works and Visualization
KIT-601 Lecture Notes-UNIT-5.pdf Frame Works and Visualization
 

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