SlideShare a Scribd company logo
1 of 10
Download to read offline
Computer Programming
Basic Elements of C/C++ Program
DIT Part 1
Lecture 3
C/C++ Operators
• C language supports a rich set of built-in
operators.
• An operator is a symbol that tells the compiler
to perform certain mathematical or logical
manipulations.
• Operators are used in program to manipulate
data and variables.
Copyrights By Tanveer Malik
C/C++ Operators
• C operators can be classified into following types.
1. Arithmetic Operators
2. Relational Operators
3. Logical Operators
4. Bitwise Operators
5. Assignment Operators (Will Discuses in Next
Chap No.3)
6. Misc Operators
Copyrights By Tanveer Malik
Arithmetic Operators
• The following table shows all the arithmetic
operators supported by the C language.
• Assume variable (A) holds value (10) and
variable (B) holds value (20)
Then:
Copyrights By Tanveer Malik
Arithmetic Operators
Copyrights By Tanveer Malik
Relational Operators
• The following table shows all the arithmetic
operators supported by the C language.
• Assume variable (A) holds value (10) and
variable (B) holds value (20)
Then:
Copyrights By Tanveer Malik
Relational Operators
Copyrights By Tanveer Malik
Logical Operators
• Following table shows all the logical operators
supported by C language.
• Assume variable (A) holds value (1) and
variable (B) holds value (0)
Then:
Copyrights By Tanveer Malik
Assignment
– C/C++ Expressions.
– C/C++ Statements.
Lecture 3

More Related Content

What's hot

What's hot (20)

Lesson 3.2 data types for memory location
Lesson 3.2 data types for memory locationLesson 3.2 data types for memory location
Lesson 3.2 data types for memory location
 
Object oriented programming 12 programming steps in cpp and example
Object oriented programming 12 programming steps in cpp and exampleObject oriented programming 12 programming steps in cpp and example
Object oriented programming 12 programming steps in cpp and example
 
Functional Scala
Functional ScalaFunctional Scala
Functional Scala
 
Juthi
JuthiJuthi
Juthi
 
Programming in c (importance of c)
Programming in c (importance of c)Programming in c (importance of c)
Programming in c (importance of c)
 
Lesson 13 object and class
Lesson 13 object and classLesson 13 object and class
Lesson 13 object and class
 
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
 
Lesson 1 introduction to programming
Lesson 1 introduction to programmingLesson 1 introduction to programming
Lesson 1 introduction to programming
 
EDM Overview of Profile and Settlement
EDM Overview of Profile and SettlementEDM Overview of Profile and Settlement
EDM Overview of Profile and Settlement
 
Comp 122 lab 3 lab report and source code
Comp 122 lab 3 lab report and source codeComp 122 lab 3 lab report and source code
Comp 122 lab 3 lab report and source code
 
URF Poster
URF PosterURF Poster
URF Poster
 
Half adder and full adder | Digital electronics | engineering
Half adder  and full adder | Digital electronics | engineeringHalf adder  and full adder | Digital electronics | engineering
Half adder and full adder | Digital electronics | engineering
 
Uploader sheet-Steps
Uploader sheet-StepsUploader sheet-Steps
Uploader sheet-Steps
 
C programming exercises and solutions
C programming exercises and solutions C programming exercises and solutions
C programming exercises and solutions
 
Cs8261 cp lab syllabus
Cs8261 cp lab syllabusCs8261 cp lab syllabus
Cs8261 cp lab syllabus
 
Chapter 02 - Problem Solving
Chapter 02 - Problem SolvingChapter 02 - Problem Solving
Chapter 02 - Problem Solving
 
EDM Overview of Formula Profile
EDM Overview of Formula ProfileEDM Overview of Formula Profile
EDM Overview of Formula Profile
 
Lecture02
Lecture02Lecture02
Lecture02
 
Half adder and full adder
Half adder and full adderHalf adder and full adder
Half adder and full adder
 
Risk Analysis of Linear Projects
Risk Analysis of Linear ProjectsRisk Analysis of Linear Projects
Risk Analysis of Linear Projects
 

Similar to Lecture 3

Csc1100 lecture03 ch03-pt2-s14
Csc1100 lecture03 ch03-pt2-s14Csc1100 lecture03 ch03-pt2-s14
Csc1100 lecture03 ch03-pt2-s14
IIUM
 
Csc1100 lecture03 ch03-pt2-s14
Csc1100 lecture03 ch03-pt2-s14Csc1100 lecture03 ch03-pt2-s14
Csc1100 lecture03 ch03-pt2-s14
IIUM
 
Chap_________________1_Introduction.pptx
Chap_________________1_Introduction.pptxChap_________________1_Introduction.pptx
Chap_________________1_Introduction.pptx
Ronaldo Aditya
 

Similar to Lecture 3 (20)

Learn C# Programming - Operators
Learn C# Programming - OperatorsLearn C# Programming - Operators
Learn C# Programming - Operators
 
Computer programming and utilization
Computer programming and utilizationComputer programming and utilization
Computer programming and utilization
 
A quick introduction to c programming
A quick introduction to c programmingA quick introduction to c programming
A quick introduction to c programming
 
Programming Fundamental Slide lecture no.2 (Section E)
Programming Fundamental Slide lecture no.2 (Section E)Programming Fundamental Slide lecture no.2 (Section E)
Programming Fundamental Slide lecture no.2 (Section E)
 
Lesson 5.2 logical operators
Lesson 5.2 logical operatorsLesson 5.2 logical operators
Lesson 5.2 logical operators
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
 
CP c++ programing project Unit 1 intro.pdf
CP c++ programing project  Unit 1 intro.pdfCP c++ programing project  Unit 1 intro.pdf
CP c++ programing project Unit 1 intro.pdf
 
C material
C materialC material
C material
 
C programming language
C programming languageC programming language
C programming language
 
Operators and Expressions in C#
Operators and Expressions in C#Operators and Expressions in C#
Operators and Expressions in C#
 
Csc1100 lecture03 ch03-pt2-s14
Csc1100 lecture03 ch03-pt2-s14Csc1100 lecture03 ch03-pt2-s14
Csc1100 lecture03 ch03-pt2-s14
 
Csc1100 lecture03 ch03-pt2-s14
Csc1100 lecture03 ch03-pt2-s14Csc1100 lecture03 ch03-pt2-s14
Csc1100 lecture03 ch03-pt2-s14
 
Basic Programming concepts - Programming with C++
Basic Programming concepts - Programming with C++Basic Programming concepts - Programming with C++
Basic Programming concepts - Programming with C++
 
C Language Part 1
C Language Part 1C Language Part 1
C Language Part 1
 
C program
C programC program
C program
 
Shivani PPt C-programing-1.pptx
Shivani PPt C-programing-1.pptxShivani PPt C-programing-1.pptx
Shivani PPt C-programing-1.pptx
 
INTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c languageINTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c language
 
Operators and it's type
Operators and it's type Operators and it's type
Operators and it's type
 
Chap_________________1_Introduction.pptx
Chap_________________1_Introduction.pptxChap_________________1_Introduction.pptx
Chap_________________1_Introduction.pptx
 
C++ ch2
C++ ch2C++ ch2
C++ ch2
 

More from Tanveer Malik

More from Tanveer Malik (20)

Lecture 12 security policy
Lecture 12 security policyLecture 12 security policy
Lecture 12 security policy
 
Lecture 11 active directory
Lecture 11 active directoryLecture 11 active directory
Lecture 11 active directory
 
Lecture 10 i pv4 & ipv6
Lecture 10 i pv4 & ipv6Lecture 10 i pv4 & ipv6
Lecture 10 i pv4 & ipv6
 
Lecture 9 file system
Lecture 9 file systemLecture 9 file system
Lecture 9 file system
 
Lecture 8 disk management
Lecture 8 disk managementLecture 8 disk management
Lecture 8 disk management
 
Lecture 6 internet services in network
Lecture 6 internet services in networkLecture 6 internet services in network
Lecture 6 internet services in network
 
Lecture 5 software to control network
Lecture 5 software to control networkLecture 5 software to control network
Lecture 5 software to control network
 
Lecture 4 sharing of resources on network
Lecture 4 sharing of resources on networkLecture 4 sharing of resources on network
Lecture 4 sharing of resources on network
 
Lecture 3 transmission media
Lecture 3 transmission mediaLecture 3 transmission media
Lecture 3 transmission media
 
Lecture 2 protocol details
Lecture 2 protocol detailsLecture 2 protocol details
Lecture 2 protocol details
 
Lecture 1 networking types roles
Lecture 1 networking types rolesLecture 1 networking types roles
Lecture 1 networking types roles
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Lecture 9
Lecture 9Lecture 9
Lecture 9
 
Lecture 8
Lecture 8Lecture 8
Lecture 8
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 

Lecture 3

  • 1. Computer Programming Basic Elements of C/C++ Program DIT Part 1 Lecture 3
  • 2. C/C++ Operators • C language supports a rich set of built-in operators. • An operator is a symbol that tells the compiler to perform certain mathematical or logical manipulations. • Operators are used in program to manipulate data and variables. Copyrights By Tanveer Malik
  • 3. C/C++ Operators • C operators can be classified into following types. 1. Arithmetic Operators 2. Relational Operators 3. Logical Operators 4. Bitwise Operators 5. Assignment Operators (Will Discuses in Next Chap No.3) 6. Misc Operators Copyrights By Tanveer Malik
  • 4. Arithmetic Operators • The following table shows all the arithmetic operators supported by the C language. • Assume variable (A) holds value (10) and variable (B) holds value (20) Then: Copyrights By Tanveer Malik
  • 6. Relational Operators • The following table shows all the arithmetic operators supported by the C language. • Assume variable (A) holds value (10) and variable (B) holds value (20) Then: Copyrights By Tanveer Malik
  • 8. Logical Operators • Following table shows all the logical operators supported by C language. • Assume variable (A) holds value (1) and variable (B) holds value (0) Then: Copyrights By Tanveer Malik