SlideShare a Scribd company logo
1 of 15
SARDAR VALLABHBHAI PATEL
INSTITUTE OF TECHNOLOGY
SVIT GTU
C OPERATOR
STRUCTURE OF C PROGRAM
#include <stdio.h>
/* Include files for input/output functions*/
#define const_namevalue
/* constant declaration if required */
main() /* Main function */
{ /* each declarations and statements are separated by semi colon */
declarations
/* variables; arrays; records;
function declarations etc */
statements
}
TYPES OF OPERATORS
• 1.ARITHMETIC OPERATOR
• 2.RELATIONAL OPERATOR
• 3.LOGICAL OPERATOR
• 4.ASSIGNMENT OPERATOR
• 5.INCREMENT & DECREMENT OPERATOR
• 6.CONDITIONAL OPERATOR
• 7.BITWISE OPERATOR
• 8.SPECIAL OPERATOR
ARITHMETIC OPERATOR
• Arithmetic operators used to perform arithmetic operation.
• There are following arithmetic operators in C language.
OPERATOR DESCRIPTION
+ Adds two operands
- Subtract second operands
from first
* Multiply two operand
/ Divide numerator by
denumerator
% Remainder of division
RELATIONAL OPERATOR
• Relational operator compare between two operands and return
in terms of true or false.
• These are following relational operators.
OPERATOR MEANING
> Greater then
< Less then
>= Greater or equal to
<= Less or equal to
= Equal to
!= Not equal to
LOGICAL OPERATOR
OPERATOR DESCRIPTION
&& Logical AND
|| Logical OR
! Logical NOT
•A logical operator is used to compare or evaluate logical and
relational expressions.
•These are following logical operator.
ASSIGNMENT OPERATOR
OPERATOR DESCRIPTION EXAMPLE
= Assigns value from
right side operands to
left side operand
A=b
+= Adds right operand to
left operand and assign
he result to left
A+=b is same as a=a+b
-= Subtracts right operand
from the left operand
and assign the result to
left operand
A-=b is same as a=a-b
*= Multiply left operand
with the right operand
and assign the result to
left operand
A*=b is same as a=a*b
/= Divides left operand
with the right operand
a/=b is same as a=a/b
INCREMENT & DECREMENT
OPERATOR
CONDITIONAL OPERATOR
• It is also known as ternary operator and used to evaluate
conditional expression.
• E.g: expr1? Expr2:expr3
• If expr1 condition is true? Then value expr2 otherwise value
expr3
BITWISE OPERATOR
• Bitwise operator perform manipulations of data at bit
level.
• These operator also perform shifting of bits from right to
left .
• Bitwise operator are not applied to float or double.
OPERATOR DESCRIPTION
& Bitwise AND
| Bitwise OR
<< Left shift
>> Right shift
SPECIAL OPERATOR
OPERATOR DESCRIPTION EXAMPLE
Sizeof Returns the size of an
variable
Sizeof(x)return size of an
variable x
Expression
Arithmetic Expression
• An expression is a combination of variables,
constants and operators written according to the
syntax of C language.
•x = x + 2 x += 2
•i = i +1 i++ or ++I
// the value of x is added with the value of i
EXAMPLE
x + y * z / 2 + p x + y -z / 2 * p
x + (y * z)/ 2 + p (x + y)-z / 2 * p
x + ((y * z) / 2)+ p (x + y) –(z / 2)* p
(x + ((y * z) / 2))+ p (x + y) –((z / 2) * p)
((x + ((y * z) / 2)) + p) ((x + y) –((z / 2) * p))
Conditional Expression
•An expression expis evaluated and
–if the value is nonzero (or true orepresented by 1) then
expression exp1is the final value
–otherwise exp2is the final value of entire expression.
exp ? exp1 : exp2

More Related Content

What's hot

Basic c operators
Basic c operatorsBasic c operators
Basic c operatorsAnuja Lad
 
Basic c operators
Basic c operatorsBasic c operators
Basic c operatorsdishti7
 
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programmingsavitamhaske
 
Logical and Conditional Operator In C language
Logical and Conditional Operator In C languageLogical and Conditional Operator In C language
Logical and Conditional Operator In C languageAbdul Rehman
 
Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressionsvishaljot_kaur
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c languagetanmaymodi4
 
Conditional operators
Conditional operatorsConditional operators
Conditional operatorsBU
 
Operators in C/C++
Operators in C/C++Operators in C/C++
Operators in C/C++Shobi P P
 
C language operators
C language operatorsC language operators
C language operatorsmarar hina
 
Expression and Operartor In C Programming
Expression and Operartor In C Programming Expression and Operartor In C Programming
Expression and Operartor In C Programming Kamal Acharya
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++Praveen M Jigajinni
 
Types of c operators ppt
Types of c operators pptTypes of c operators ppt
Types of c operators pptViraj Shah
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++bajiajugal
 

What's hot (20)

Basic c operators
Basic c operatorsBasic c operators
Basic c operators
 
Operator of C language
Operator of C languageOperator of C language
Operator of C language
 
Basic c operators
Basic c operatorsBasic c operators
Basic c operators
 
6 operators-in-c
6 operators-in-c6 operators-in-c
6 operators-in-c
 
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programming
 
C – operators and expressions
C – operators and expressionsC – operators and expressions
C – operators and expressions
 
Logical and Conditional Operator In C language
Logical and Conditional Operator In C languageLogical and Conditional Operator In C language
Logical and Conditional Operator In C language
 
Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressions
 
COM1407: C Operators
COM1407: C OperatorsCOM1407: C Operators
COM1407: C Operators
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c language
 
Conditional operators
Conditional operatorsConditional operators
Conditional operators
 
Operators in C/C++
Operators in C/C++Operators in C/C++
Operators in C/C++
 
C language operators
C language operatorsC language operators
C language operators
 
Expression and Operartor In C Programming
Expression and Operartor In C Programming Expression and Operartor In C Programming
Expression and Operartor In C Programming
 
Arithmetic operator
Arithmetic operatorArithmetic operator
Arithmetic operator
 
Operators in C & C++ Language
Operators in C & C++ LanguageOperators in C & C++ Language
Operators in C & C++ Language
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++
 
Types of c operators ppt
Types of c operators pptTypes of c operators ppt
Types of c operators ppt
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++
 

Viewers also liked

Team134_PizzaHut_Plansbook2015_updated
Team134_PizzaHut_Plansbook2015_updatedTeam134_PizzaHut_Plansbook2015_updated
Team134_PizzaHut_Plansbook2015_updatedAlyssa Chavez
 
07 yanire unibertsoa
07 yanire unibertsoa07 yanire unibertsoa
07 yanire unibertsoa3ZIKLO
 
Diary 2nd meeting with students szazhalombatta hungary
Diary   2nd meeting with students szazhalombatta hungaryDiary   2nd meeting with students szazhalombatta hungary
Diary 2nd meeting with students szazhalombatta hungaryread in europe
 
Biodata-Aditi V Nayak
Biodata-Aditi V NayakBiodata-Aditi V Nayak
Biodata-Aditi V NayakAditi Nayak
 
Diary meeting for teachers in Skuodas lithuania
Diary   meeting for teachers in Skuodas lithuaniaDiary   meeting for teachers in Skuodas lithuania
Diary meeting for teachers in Skuodas lithuaniaread in europe
 
Presentation_ENG_full_07_06_16
Presentation_ENG_full_07_06_16Presentation_ENG_full_07_06_16
Presentation_ENG_full_07_06_16Andy Kozlov
 
Heresey in the church of 12 factors
Heresey in the church of 12 factorsHeresey in the church of 12 factors
Heresey in the church of 12 factorsSteve Wong
 
Tarea 6 scopus
Tarea 6   scopusTarea 6   scopus
Tarea 6 scopusBea Panini
 
Fp me reporte aplicación aamtic_g113_ángela mancilla
Fp me reporte aplicación aamtic_g113_ángela mancillaFp me reporte aplicación aamtic_g113_ángela mancilla
Fp me reporte aplicación aamtic_g113_ángela mancillaangellina331
 
Jasmine Ng resume doc
Jasmine Ng resume docJasmine Ng resume doc
Jasmine Ng resume docJasmine Ng
 
Proactively using social media throughout a crisis
Proactively using social media throughout a crisisProactively using social media throughout a crisis
Proactively using social media throughout a crisisStephen Thompson
 
Global Sponsorship Packet 2015
Global Sponsorship Packet 2015Global Sponsorship Packet 2015
Global Sponsorship Packet 2015Trinh Duong
 
dumps for sale
dumps for saledumps for sale
dumps for salemikscott
 

Viewers also liked (20)

Team134_PizzaHut_Plansbook2015_updated
Team134_PizzaHut_Plansbook2015_updatedTeam134_PizzaHut_Plansbook2015_updated
Team134_PizzaHut_Plansbook2015_updated
 
07 yanire unibertsoa
07 yanire unibertsoa07 yanire unibertsoa
07 yanire unibertsoa
 
Diary 2nd meeting with students szazhalombatta hungary
Diary   2nd meeting with students szazhalombatta hungaryDiary   2nd meeting with students szazhalombatta hungary
Diary 2nd meeting with students szazhalombatta hungary
 
Biodata-Aditi V Nayak
Biodata-Aditi V NayakBiodata-Aditi V Nayak
Biodata-Aditi V Nayak
 
Diary meeting for teachers in Skuodas lithuania
Diary   meeting for teachers in Skuodas lithuaniaDiary   meeting for teachers in Skuodas lithuania
Diary meeting for teachers in Skuodas lithuania
 
Presentation_ENG_full_07_06_16
Presentation_ENG_full_07_06_16Presentation_ENG_full_07_06_16
Presentation_ENG_full_07_06_16
 
Heresey in the church of 12 factors
Heresey in the church of 12 factorsHeresey in the church of 12 factors
Heresey in the church of 12 factors
 
Tarea 6 scopus
Tarea 6   scopusTarea 6   scopus
Tarea 6 scopus
 
FRCP.Infographic
FRCP.InfographicFRCP.Infographic
FRCP.Infographic
 
Fp me reporte aplicación aamtic_g113_ángela mancilla
Fp me reporte aplicación aamtic_g113_ángela mancillaFp me reporte aplicación aamtic_g113_ángela mancilla
Fp me reporte aplicación aamtic_g113_ángela mancilla
 
20161203 icadlpresentation-sittisak
20161203 icadlpresentation-sittisak20161203 icadlpresentation-sittisak
20161203 icadlpresentation-sittisak
 
Jasmine Ng resume doc
Jasmine Ng resume docJasmine Ng resume doc
Jasmine Ng resume doc
 
Proactively using social media throughout a crisis
Proactively using social media throughout a crisisProactively using social media throughout a crisis
Proactively using social media throughout a crisis
 
Project PPT
Project PPTProject PPT
Project PPT
 
baddiny's c.v
baddiny's c.vbaddiny's c.v
baddiny's c.v
 
Global Sponsorship Packet 2015
Global Sponsorship Packet 2015Global Sponsorship Packet 2015
Global Sponsorship Packet 2015
 
Revolucion francesa
Revolucion francesaRevolucion francesa
Revolucion francesa
 
Pasteur, Rome
Pasteur, RomePasteur, Rome
Pasteur, Rome
 
Media pitch final
Media pitch  finalMedia pitch  final
Media pitch final
 
dumps for sale
dumps for saledumps for sale
dumps for sale
 

Similar to C OPERATOR

Cs1123 4 variables_constants
Cs1123 4 variables_constantsCs1123 4 variables_constants
Cs1123 4 variables_constantsTAlha MAlik
 
OPERATORS IN C.pptx
OPERATORS IN C.pptxOPERATORS IN C.pptx
OPERATORS IN C.pptxAshokJ19
 
Introduction to c
Introduction to cIntroduction to c
Introduction to cAjeet Kumar
 
Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5FabMinds
 
Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Rasan Samarasinghe
 
Chapter 2: Elementary Programming
Chapter 2: Elementary ProgrammingChapter 2: Elementary Programming
Chapter 2: Elementary ProgrammingEric Chou
 
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
 
Programming fundamentals 2:pointers in c++ clearly explained
Programming fundamentals 2:pointers in c++ clearly explainedProgramming fundamentals 2:pointers in c++ clearly explained
Programming fundamentals 2:pointers in c++ clearly explainedhozaifafadl
 
03 Operators and expressions
03 Operators and expressions03 Operators and expressions
03 Operators and expressionsmaznabili
 

Similar to C OPERATOR (20)

Cs1123 4 variables_constants
Cs1123 4 variables_constantsCs1123 4 variables_constants
Cs1123 4 variables_constants
 
Coper in C
Coper in CCoper in C
Coper in C
 
3d7b7 session4 c++
3d7b7 session4 c++3d7b7 session4 c++
3d7b7 session4 c++
 
OPERATORS IN C.pptx
OPERATORS IN C.pptxOPERATORS IN C.pptx
OPERATORS IN C.pptx
 
OPERATORS IN C.pptx
OPERATORS IN C.pptxOPERATORS IN C.pptx
OPERATORS IN C.pptx
 
C Language Part 1
C Language Part 1C Language Part 1
C Language Part 1
 
Operators in C++
Operators in C++Operators in C++
Operators in C++
 
Introduction to c
Introduction to cIntroduction to c
Introduction to c
 
Basic commands in C++
Basic commands in C++Basic commands in C++
Basic commands in C++
 
Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5
 
Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++
 
Types of Operators in C
Types of Operators in CTypes of Operators in C
Types of Operators in C
 
Prog1-L2.pptx
Prog1-L2.pptxProg1-L2.pptx
Prog1-L2.pptx
 
Chapter 2: Elementary Programming
Chapter 2: Elementary ProgrammingChapter 2: Elementary Programming
Chapter 2: Elementary Programming
 
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
 
Introduction to c
Introduction to cIntroduction to c
Introduction to c
 
c-programming
c-programmingc-programming
c-programming
 
Programming fundamentals 2:pointers in c++ clearly explained
Programming fundamentals 2:pointers in c++ clearly explainedProgramming fundamentals 2:pointers in c++ clearly explained
Programming fundamentals 2:pointers in c++ clearly explained
 
03 Operators and expressions
03 Operators and expressions03 Operators and expressions
03 Operators and expressions
 

Recently uploaded

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

C OPERATOR

  • 1. SARDAR VALLABHBHAI PATEL INSTITUTE OF TECHNOLOGY SVIT GTU C OPERATOR
  • 2. STRUCTURE OF C PROGRAM #include <stdio.h> /* Include files for input/output functions*/ #define const_namevalue /* constant declaration if required */ main() /* Main function */ { /* each declarations and statements are separated by semi colon */ declarations /* variables; arrays; records; function declarations etc */ statements }
  • 3. TYPES OF OPERATORS • 1.ARITHMETIC OPERATOR • 2.RELATIONAL OPERATOR • 3.LOGICAL OPERATOR • 4.ASSIGNMENT OPERATOR • 5.INCREMENT & DECREMENT OPERATOR • 6.CONDITIONAL OPERATOR • 7.BITWISE OPERATOR • 8.SPECIAL OPERATOR
  • 4. ARITHMETIC OPERATOR • Arithmetic operators used to perform arithmetic operation. • There are following arithmetic operators in C language. OPERATOR DESCRIPTION + Adds two operands - Subtract second operands from first * Multiply two operand / Divide numerator by denumerator % Remainder of division
  • 5. RELATIONAL OPERATOR • Relational operator compare between two operands and return in terms of true or false. • These are following relational operators. OPERATOR MEANING > Greater then < Less then >= Greater or equal to <= Less or equal to = Equal to != Not equal to
  • 6. LOGICAL OPERATOR OPERATOR DESCRIPTION && Logical AND || Logical OR ! Logical NOT •A logical operator is used to compare or evaluate logical and relational expressions. •These are following logical operator.
  • 7. ASSIGNMENT OPERATOR OPERATOR DESCRIPTION EXAMPLE = Assigns value from right side operands to left side operand A=b += Adds right operand to left operand and assign he result to left A+=b is same as a=a+b -= Subtracts right operand from the left operand and assign the result to left operand A-=b is same as a=a-b *= Multiply left operand with the right operand and assign the result to left operand A*=b is same as a=a*b /= Divides left operand with the right operand a/=b is same as a=a/b
  • 9. CONDITIONAL OPERATOR • It is also known as ternary operator and used to evaluate conditional expression. • E.g: expr1? Expr2:expr3 • If expr1 condition is true? Then value expr2 otherwise value expr3
  • 10. BITWISE OPERATOR • Bitwise operator perform manipulations of data at bit level. • These operator also perform shifting of bits from right to left . • Bitwise operator are not applied to float or double. OPERATOR DESCRIPTION & Bitwise AND | Bitwise OR << Left shift >> Right shift
  • 11. SPECIAL OPERATOR OPERATOR DESCRIPTION EXAMPLE Sizeof Returns the size of an variable Sizeof(x)return size of an variable x
  • 13. Arithmetic Expression • An expression is a combination of variables, constants and operators written according to the syntax of C language. •x = x + 2 x += 2 •i = i +1 i++ or ++I // the value of x is added with the value of i
  • 14. EXAMPLE x + y * z / 2 + p x + y -z / 2 * p x + (y * z)/ 2 + p (x + y)-z / 2 * p x + ((y * z) / 2)+ p (x + y) –(z / 2)* p (x + ((y * z) / 2))+ p (x + y) –((z / 2) * p) ((x + ((y * z) / 2)) + p) ((x + y) –((z / 2) * p))
  • 15. Conditional Expression •An expression expis evaluated and –if the value is nonzero (or true orepresented by 1) then expression exp1is the final value –otherwise exp2is the final value of entire expression. exp ? exp1 : exp2