SlideShare a Scribd company logo
1 of 5
Types Data Types
Basic Data Type int,char, float,double
DerivedDataType array, pointer,structure,union
EnumerationDataType enum
VoidData Type void
Type Storage size Value range
char 1 byte -128 to 127 or 0 to 255
unsignedchar 1 byte 0 to 255
signedchar 1 byte -128 to 127
int 2 or 4 bytes
-32,768 to 32,767 or -2,147,483,648 to
2,147,483,647
unsignedint 2 or 4 bytes 0 to 65,535 or 0 to 4,294,967,295
short 2 bytes -32,768 to 32,767
unsignedshort 2 bytes 0 to 65,535
long 8 bytesor (4bytesfor32 bitOS) -9223372036854775808 to 9223372036854775807
unsignedlong 8 bytes 0 to 18446744073709551615
Type Size (bytes) Format Specifier
int at least2, usually4 %d,%i
char 1 %c
float 4 %f
double 8 %lf
short int 2 usually %hd
unsignedint at least2, usually4 %u
longint at least4, usually8 %ld,%li
longlongint at least8 %lld,%lli
unsignedlongint at least4 %lu
unsignedlonglongint at least8 %llu
signedchar 1 %c
unsignedchar 1 %c
longdouble at least10, usually12 or 16 %Lf
intid,age;
floatsalary;
double price;
longa;
longlongb;
longdouble c;
KeywordsinC
A keywor d isa reservedword.You cannot use it as a variable name,constantname,etc.
There are only32 reservedwords(keywords) in the Clanguage.
A listof 32 keywordsinthe c language isgivenbelow:
auto break case char const continue default do
double else enum extern float for goto if
int long register return short signed sizeof static
struct switch typedef union unsigned void volatile while
There are followingtypesof operatorstoperformdifferenttypesof operationsinClanguage.
1. ArithmeticOperators
2. Relational Operators
3. ShiftOperators
4. Logical Operators
5. Bitwise Operators
6. Ternaryor ConditionalOperators
7. AssignmentOperator
8. Misc Operator
ArithmeticOperators
The followingtable showsall the arithmeticoperatorssupportedbythe Clanguage.Assume
variable Aholds10 and variable Bholds20 then−
Operator Description Example
+ Addstwooperands. A + B = 30
− Subtractssecondoperandfromthe first. A − B = -10
* Multipliesbothoperands. A * B = 200
/ Dividesnumeratorbyde-numerator. B / A = 2
% ModulusOperatorand remainderof afteranintegerdivision. B % A = 0
++ Incrementoperatorincreasesthe integervaluebyone. A++ = 11
-- Decrementoperatordecreasesthe integervalue byone. A-- = 9
Relational Operators
The followingtable showsall the relational operatorssupportedbyC.Assume variable Aholds10
and variable Bholds20 then−
Operator Description Example
== Checksif the valuesof twooperandsare equal or not.If yes,thenthe condition
becomestrue.
(A == B)
isnot
true.
!= Checksif the valuesof twooperandsare equal or not.If the valuesare not equal,
thenthe conditionbecomestrue.
(A != B)
istrue.
> Checksif the value of leftoperandisgreaterthanthe value of right operand.If yes,
thenthe conditionbecomestrue.
(A > B) is
not
true.
< Checksif the value of leftoperandislessthanthe value of rightoperand.If yes,then
the conditionbecomestrue.
(A < B) is
true.
>= Checksif the value of leftoperandisgreaterthanor equal to the value of right
operand.If yes,thenthe conditionbecomestrue.
(A >= B)
isnot
true.
<= Checksif the value of leftoperandislessthanor equal tothe value of right operand.
If yes,thenthe conditionbecomestrue.
(A <= B)
istrue.
Logical Operators
Followingtableshowsall the logical operatorssupportedbyClanguage.Assume variable Aholds1
and variable Bholds0, then−
Operator Description Example
&& CalledLogical ANDoperator.If boththe operandsare non-zero,thenthe condition
becomestrue.
(A &&
B) is
false.
|| CalledLogical OROperator.If any of the twooperandsisnon-zero,thenthe
conditionbecomestrue.
(A || B)
istrue.
! CalledLogical NOTOperator.Itis usedtoreverse the logical state of itsoperand.If a
conditionistrue,thenLogical NOToperatorwill make itfalse.
!(A &&
B) is
true.

More Related Content

What's hot

C bitwise operators
C bitwise operatorsC bitwise operators
C bitwise operatorsSuneel Dogra
 
Python Basic Operators
Python Basic OperatorsPython Basic Operators
Python Basic OperatorsSoba Arjun
 
Chapter 5 - Operators in C++
Chapter 5 - Operators in C++Chapter 5 - Operators in C++
Chapter 5 - Operators in C++Deepak Singh
 
Operation and expression in c++
Operation and expression in c++Operation and expression in c++
Operation and expression in c++Online
 
The Ring programming language version 1.6 book - Part 21 of 189
The Ring programming language version 1.6 book - Part 21 of 189The Ring programming language version 1.6 book - Part 21 of 189
The Ring programming language version 1.6 book - Part 21 of 189Mahmoud Samir Fayed
 
Flowchart pseudocode-examples
Flowchart pseudocode-examplesFlowchart pseudocode-examples
Flowchart pseudocode-examplesGautam Roy
 
Operators in python
Operators in pythonOperators in python
Operators in pythoneShikshak
 
Subtracter
SubtracterSubtracter
SubtracterKumar
 
Lesson 11. Pattern 3. Shift operations
Lesson 11. Pattern 3. Shift operationsLesson 11. Pattern 3. Shift operations
Lesson 11. Pattern 3. Shift operationsPVS-Studio
 
Booth multiplication
Booth multiplicationBooth multiplication
Booth multiplicationM Madan Gopal
 
C programming operators
C programming operatorsC programming operators
C programming operatorsSuneel Dogra
 
Multiplication algorithm
Multiplication algorithmMultiplication algorithm
Multiplication algorithmGaurav Subham
 
Module 00 Bitwise Operators in C
Module 00 Bitwise Operators in CModule 00 Bitwise Operators in C
Module 00 Bitwise Operators in CTushar B Kute
 

What's hot (18)

C bitwise operators
C bitwise operatorsC bitwise operators
C bitwise operators
 
Python Basic Operators
Python Basic OperatorsPython Basic Operators
Python Basic Operators
 
Chapter 5 - Operators in C++
Chapter 5 - Operators in C++Chapter 5 - Operators in C++
Chapter 5 - Operators in C++
 
Operation and expression in c++
Operation and expression in c++Operation and expression in c++
Operation and expression in c++
 
The Ring programming language version 1.6 book - Part 21 of 189
The Ring programming language version 1.6 book - Part 21 of 189The Ring programming language version 1.6 book - Part 21 of 189
The Ring programming language version 1.6 book - Part 21 of 189
 
Operators in c++
Operators in c++Operators in c++
Operators in c++
 
Flowchart pseudocode-examples
Flowchart pseudocode-examplesFlowchart pseudocode-examples
Flowchart pseudocode-examples
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Bitwise operators
Bitwise operatorsBitwise operators
Bitwise operators
 
Subtracter
SubtracterSubtracter
Subtracter
 
Lesson 11. Pattern 3. Shift operations
Lesson 11. Pattern 3. Shift operationsLesson 11. Pattern 3. Shift operations
Lesson 11. Pattern 3. Shift operations
 
Booth multiplication
Booth multiplicationBooth multiplication
Booth multiplication
 
Operators in C & C++ Language
Operators in C & C++ LanguageOperators in C & C++ Language
Operators in C & C++ Language
 
C programming operators
C programming operatorsC programming operators
C programming operators
 
C Sharp Jn (2)
C Sharp Jn (2)C Sharp Jn (2)
C Sharp Jn (2)
 
Multiplication algorithm
Multiplication algorithmMultiplication algorithm
Multiplication algorithm
 
Module 00 Bitwise Operators in C
Module 00 Bitwise Operators in CModule 00 Bitwise Operators in C
Module 00 Bitwise Operators in C
 

Similar to Data types

C++ revision add on till now
C++ revision add on till nowC++ revision add on till now
C++ revision add on till nowAmAn Singh
 
C++ revision add on till now
C++ revision add on till nowC++ revision add on till now
C++ revision add on till nowAmAn Singh
 
CSharp Language Overview Part 1
CSharp Language Overview Part 1CSharp Language Overview Part 1
CSharp Language Overview Part 1Hossein Zahed
 
PE1 Module 2.ppt
PE1 Module 2.pptPE1 Module 2.ppt
PE1 Module 2.pptbalewayalew
 
C Programming Language Step by Step Part 3
C Programming Language Step by Step Part 3C Programming Language Step by Step Part 3
C Programming Language Step by Step Part 3Rumman Ansari
 
guia de referencia para a linguagem do fabricante CCS info_syntax.pdf
guia de referencia para a linguagem do fabricante CCS info_syntax.pdfguia de referencia para a linguagem do fabricante CCS info_syntax.pdf
guia de referencia para a linguagem do fabricante CCS info_syntax.pdfSilvanildoManoeldaSi
 
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 laLEOFAKE
 
02. Primitive Data Types and Variables
02. Primitive Data Types and Variables02. Primitive Data Types and Variables
02. Primitive Data Types and VariablesIntro C# Book
 
Python programming workshop
Python programming workshopPython programming workshop
Python programming workshopBAINIDA
 
Programming presentation
Programming presentationProgramming presentation
Programming presentationFiaz Khokhar
 
the refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptxthe refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptxAnkitaVerma776806
 

Similar to Data types (20)

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
 
C tutorial
C tutorialC tutorial
C tutorial
 
Python
PythonPython
Python
 
CSharp Language Overview Part 1
CSharp Language Overview Part 1CSharp Language Overview Part 1
CSharp Language Overview Part 1
 
c_tutorial_2.ppt
c_tutorial_2.pptc_tutorial_2.ppt
c_tutorial_2.ppt
 
Unit i intro-operators
Unit   i intro-operatorsUnit   i intro-operators
Unit i intro-operators
 
PE1 Module 2.ppt
PE1 Module 2.pptPE1 Module 2.ppt
PE1 Module 2.ppt
 
Programming in Arduino (Part 1)
Programming in Arduino (Part 1)Programming in Arduino (Part 1)
Programming in Arduino (Part 1)
 
C Programming Language Step by Step Part 3
C Programming Language Step by Step Part 3C Programming Language Step by Step Part 3
C Programming Language Step by Step Part 3
 
guia de referencia para a linguagem do fabricante CCS info_syntax.pdf
guia de referencia para a linguagem do fabricante CCS info_syntax.pdfguia de referencia para a linguagem do fabricante CCS info_syntax.pdf
guia de referencia para a linguagem do fabricante CCS info_syntax.pdf
 
CPU
CPUCPU
CPU
 
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
 
02. Primitive Data Types and Variables
02. Primitive Data Types and Variables02. Primitive Data Types and Variables
02. Primitive Data Types and Variables
 
Vb script final pari
Vb script final pariVb script final pari
Vb script final pari
 
Python programming workshop
Python programming workshopPython programming workshop
Python programming workshop
 
Programming presentation
Programming presentationProgramming presentation
Programming presentation
 
Vcs14
Vcs14Vcs14
Vcs14
 
Datatypes & variables in java
Datatypes & variables in javaDatatypes & variables in java
Datatypes & variables in java
 
the refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptxthe refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptx
 

Recently uploaded

Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Andrea Goulet
 
CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfFurqanuddin10
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Gáspár Nagy
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfWSO2
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfVictor Lopez
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdfkalichargn70th171
 
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesNeo4j
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabbereGrabber
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAlluxio, Inc.
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationHelp Desk Migration
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationWave PLM
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...Alluxio, Inc.
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfsteffenkarlsson2
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024Shane Coughlan
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Henry Schreiner
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems ApproachNeo4j
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Soroosh Khodami
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfMehmet Akar
 

Recently uploaded (20)

Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 
CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdf
 
AI Hackathon.pptx
AI                        Hackathon.pptxAI                        Hackathon.pptx
AI Hackathon.pptx
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdf
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf
 
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabber
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data Migration
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdf
 

Data types

  • 1. Types Data Types Basic Data Type int,char, float,double DerivedDataType array, pointer,structure,union EnumerationDataType enum VoidData Type void Type Storage size Value range char 1 byte -128 to 127 or 0 to 255 unsignedchar 1 byte 0 to 255 signedchar 1 byte -128 to 127 int 2 or 4 bytes -32,768 to 32,767 or -2,147,483,648 to 2,147,483,647 unsignedint 2 or 4 bytes 0 to 65,535 or 0 to 4,294,967,295 short 2 bytes -32,768 to 32,767 unsignedshort 2 bytes 0 to 65,535 long 8 bytesor (4bytesfor32 bitOS) -9223372036854775808 to 9223372036854775807
  • 2. unsignedlong 8 bytes 0 to 18446744073709551615 Type Size (bytes) Format Specifier int at least2, usually4 %d,%i char 1 %c float 4 %f double 8 %lf short int 2 usually %hd unsignedint at least2, usually4 %u longint at least4, usually8 %ld,%li longlongint at least8 %lld,%lli unsignedlongint at least4 %lu unsignedlonglongint at least8 %llu signedchar 1 %c unsignedchar 1 %c longdouble at least10, usually12 or 16 %Lf
  • 3. intid,age; floatsalary; double price; longa; longlongb; longdouble c; KeywordsinC A keywor d isa reservedword.You cannot use it as a variable name,constantname,etc. There are only32 reservedwords(keywords) in the Clanguage. A listof 32 keywordsinthe c language isgivenbelow: auto break case char const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while There are followingtypesof operatorstoperformdifferenttypesof operationsinClanguage. 1. ArithmeticOperators 2. Relational Operators 3. ShiftOperators 4. Logical Operators 5. Bitwise Operators 6. Ternaryor ConditionalOperators 7. AssignmentOperator 8. Misc Operator
  • 4. ArithmeticOperators The followingtable showsall the arithmeticoperatorssupportedbythe Clanguage.Assume variable Aholds10 and variable Bholds20 then− Operator Description Example + Addstwooperands. A + B = 30 − Subtractssecondoperandfromthe first. A − B = -10 * Multipliesbothoperands. A * B = 200 / Dividesnumeratorbyde-numerator. B / A = 2 % ModulusOperatorand remainderof afteranintegerdivision. B % A = 0 ++ Incrementoperatorincreasesthe integervaluebyone. A++ = 11 -- Decrementoperatordecreasesthe integervalue byone. A-- = 9 Relational Operators The followingtable showsall the relational operatorssupportedbyC.Assume variable Aholds10 and variable Bholds20 then− Operator Description Example == Checksif the valuesof twooperandsare equal or not.If yes,thenthe condition becomestrue. (A == B) isnot true. != Checksif the valuesof twooperandsare equal or not.If the valuesare not equal, thenthe conditionbecomestrue. (A != B) istrue.
  • 5. > Checksif the value of leftoperandisgreaterthanthe value of right operand.If yes, thenthe conditionbecomestrue. (A > B) is not true. < Checksif the value of leftoperandislessthanthe value of rightoperand.If yes,then the conditionbecomestrue. (A < B) is true. >= Checksif the value of leftoperandisgreaterthanor equal to the value of right operand.If yes,thenthe conditionbecomestrue. (A >= B) isnot true. <= Checksif the value of leftoperandislessthanor equal tothe value of right operand. If yes,thenthe conditionbecomestrue. (A <= B) istrue. Logical Operators Followingtableshowsall the logical operatorssupportedbyClanguage.Assume variable Aholds1 and variable Bholds0, then− Operator Description Example && CalledLogical ANDoperator.If boththe operandsare non-zero,thenthe condition becomestrue. (A && B) is false. || CalledLogical OROperator.If any of the twooperandsisnon-zero,thenthe conditionbecomestrue. (A || B) istrue. ! CalledLogical NOTOperator.Itis usedtoreverse the logical state of itsoperand.If a conditionistrue,thenLogical NOToperatorwill make itfalse. !(A && B) is true.