SlideShare a Scribd company logo
1 of 19
OPERATORS
N.V.RAJA SEKHAR REDDY
C Programming Tutorials
www.programming9.com
What is an operator?
 An operator is a symbol that tells the
computer to perform certain mathematical
or logical manipulations.
 These operators are used in programs to
manipulate data and variables.
2 www.programming9.com
Types of Operators
1. Arithmetic operators
2. Relational operators
3. Logical operators
4. Assignment operators
5. Increment and decrement
operators
6. Conditional operators
7. Bitwise operators
8. Special operators3 www.programming9.com
ARITHMETIC OPERATORS:
 Arithmetic operators are used to perform numerical
calculations among the values.
OPERATOR MEANING
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulo Division
4 www.programming9.com
#include<stdio.h>
int main()
{
int a, b, add, sub, mul, div, rem;
printf("Enter a, b values : ");
scanf("%d%d",&a,&b); // Reading two values
add=a+b; // Addition Operator
sub=a-b; // Subtraction Operator
mul=a*b; // Multiplication Operator
div=a/b; // Division Operator
rem=a%b; // Remainder (Modulo) Operator
printf("Result of addition is=%dn", add);
printf("Result of subtraction=%dn", sub);
printf("Result of multiplication is=%dn", mul);
printf("Result of division is=%dn", div);
printf("Result of remainder=%dn",rem);
return 0; }
5 www.programming9.com
RELATIONAL OPERATOR:
 Relational Operators are used to compare two
quantities and take certain decision depending on
their relation.
If the specified relation is true it returns one.
If the specified relation is false it returns zero.
OPERATOR MEANING
< Is less than
<= Is less than or equal to
> Is greater than
>= Is greater than or equal to
== Is equal to
!= Is not equal to
6 www.programming9.com
#include<stdio.h>
void main()
{
int a, b;
printf(“Enter values for a and b : ");
scanf("%d %d", &a, &b);
printf("n The < value of a is %d", a<b);
printf("n The <= value of a is %d", a<=b);
printf("n The > value of a is %d", a>b);
printf("n The >= value of a is %d", a>=b);
printf("n The == value of a is %d", a==b);
printf("n The != value of a is %d", a!=b);
}
7 www.programming9.com
Example Program
LOGICAL OPERATORS:
 These operators are used for testing more than one
condition and making decisions.
'c' has three logical operators they are:
OPERATOR MEANING
&& Logical AND
|| Logical OR
! Logical NOT
8 www.programming9.com
Logical Operators Example Program
#include<stdio.h>
void main()
{
int a, b;
printf(“Enter values for a and b : ");
scanf(“%d %d", &a, &b);
printf("n %d",(a<b)&&(a!=b));
printf("n %d",(a<b)||(b<a));
printf("n %d",!(a==b));
}
9 www.programming9.com
ASSIGNMENT OPERATORS
 These operators are used for assigning the result of
an expression to a variable.
 b=a;
OPERATORS:
==, +=, -=, *=, /=, %=,
>>=, <<=, &=, |=, ^=
10 www.programming9.com
Assignment Operators Example
#include<stdio.h>
void main()
{
int a, b, c;
printf("Enter the values for a and b : ");
scanf("%d %d",&a,&b);
printf("n the values of= is:%d",c=a+b);
printf("n the values of +=is:%d",c+=b);
printf("n the value of-= is:%d",c-=a);
printf("n the value of *=is:%d",c*=a);
printf("n the value of /=is:%d",c/=b);
printf("n the value of %=is:%d",c%=b);
}
11 www.programming9.com
INCREMENT & DECREMENT
OPERATORS
Two most useful operators which are present in 'c'
are increment and decrement operators.
Operators: ++ and --
The operator ++ adds one to the operand
The operator -- subtracts one from the operand.
Both are unary operators and can be used as pre or
post increment/decrement.
12 www.programming9.com
INCREMENT & DECREMENT OPERATORS
EXAMPLE
#include<stdio.h>
void main()
{
int a,b,c;
printf("Enter the values for a and b :");
scanf("%d %d", &a, &b);
printf("n The value of c is %d", c=++a);
printf("n The value of c is %d", c=a++);
printf("n The value of c is %d", c=--b);
printf("n The value of c is %d", c=b--);
}
13 www.programming9.com
CONDITIONAL OPERATORS
These conditional operator are used to construct
conditional expressions of the form.
Syntax:
exp1?exp2:exp3.
where exp1,exp2,exp3 are expressions.
Operator: ?: (ternary operator)
14 www.programming9.com
Conditional Operators Example
#include<stdio.h>
void main()
{
int a, b, x;
printf("Enter the values of a add b : ");
scanf("%d %d", &a, &b);
x=(a>b)?a:b;
printf("Biggest Value is :%d",x);
}
15 www.programming9.com
BITWISE OPERATORS
 These operators works on bit level
 Applied to Integers only
OPERATOR MEANING
& Bitwise AND
| Bitwise OR
^ Bitwise Exclusive OR
<< Shift Left
>> Shift Right
16 www.programming9.com
SPECIAL OPERATORS
'C' supports some special operators such as
comma operator, sizeof operator and pointer
operators.
Comma operator:
the comma operator is used to combine
related expressions.
A comma linked list of expressions are
evaluated left to right and the value of right most
expression is the value of combined
expression..
Example: value=(x=10, y=5, x+y);
17 www.programming9.com
Special Operators Contd…
Sizeof Operator:
Sizeof is an operator used to return the number
of bytes the operand occupies.
Syntax:
m=sizeof(sum);
k=sizeof(2351);
18 www.programming9.com
www.programming9.com
Like us @
www.facebook.com/programming9
19 www.programming9.com

More Related Content

What's hot

Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programmingavikdhupar
 
Decision making statements in C programming
Decision making statements in C programmingDecision making statements in C programming
Decision making statements in C programmingRabin BK
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C ProgrammingShuvongkor Barman
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGAbhishek Dwivedi
 
Conditional Statement in C Language
Conditional Statement in C LanguageConditional Statement in C Language
Conditional Statement in C LanguageShaina Arora
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C v_jk
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programmingTejaswiB4
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c languagetanmaymodi4
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programmingprogramming9
 

What's hot (20)

Operators in python
Operators in pythonOperators in python
Operators in python
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
 
Programming in c Arrays
Programming in c ArraysProgramming in c Arrays
Programming in c Arrays
 
History of c
History of cHistory of c
History of c
 
Decision making statements in C programming
Decision making statements in C programmingDecision making statements in C programming
Decision making statements in C programming
 
Functions in C
Functions in CFunctions in C
Functions in C
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
Break and continue
Break and continueBreak and continue
Break and continue
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
 
Array ppt
Array pptArray ppt
Array ppt
 
Conditional Statement in C Language
Conditional Statement in C LanguageConditional Statement in C Language
Conditional Statement in C Language
 
File handling in c
File handling in cFile handling in c
File handling in c
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programming
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c language
 
Function in C program
Function in C programFunction in C program
Function in C program
 
Arrays
ArraysArrays
Arrays
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
 
C by balaguruswami - e.balagurusamy
C   by balaguruswami - e.balagurusamyC   by balaguruswami - e.balagurusamy
C by balaguruswami - e.balagurusamy
 
Strings in python
Strings in pythonStrings in python
Strings in python
 

Viewers also liked

Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]Abhishek Sinha
 
Relational operators In C language (By: Shujaat Abbas)
Relational operators In C language (By: Shujaat Abbas)Relational operators In C language (By: Shujaat Abbas)
Relational operators In C language (By: Shujaat Abbas)Shujaat Abbas
 
Types of operators in C
Types of operators in CTypes of operators in C
Types of operators in CPrabhu Govind
 
Complete C programming Language Course
Complete C programming Language CourseComplete C programming Language Course
Complete C programming Language CourseVivek chan
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’eShikshak
 
Autonomous RC car using gps
Autonomous RC car using gpsAutonomous RC car using gps
Autonomous RC car using gpsma_np
 
C++ idioms by example (Nov 2008)
C++ idioms by example (Nov 2008)C++ idioms by example (Nov 2008)
C++ idioms by example (Nov 2008)Olve Maudal
 
Advance Microcontroller AVR
Advance Microcontroller AVRAdvance Microcontroller AVR
Advance Microcontroller AVRDaksh Raj Chopra
 
AVR Fundamentals
AVR FundamentalsAVR Fundamentals
AVR FundamentalsVinit Vyas
 
Introduction to AVR Microcontroller
Introduction to AVR Microcontroller Introduction to AVR Microcontroller
Introduction to AVR Microcontroller Mahmoud Sadat
 
Arithmetic Logic Unit (ALU)
Arithmetic Logic Unit (ALU)Arithmetic Logic Unit (ALU)
Arithmetic Logic Unit (ALU)Student
 
AVR Microcontroller
AVR MicrocontrollerAVR Microcontroller
AVR MicrocontrollerÖzcan Acar
 
Operators in c language
Operators in c languageOperators in c language
Operators in c languageAmit Singh
 
AVR programming - BASICS
AVR programming - BASICSAVR programming - BASICS
AVR programming - BASICSRobotix 2011
 

Viewers also liked (19)

Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]
 
Relational operators In C language (By: Shujaat Abbas)
Relational operators In C language (By: Shujaat Abbas)Relational operators In C language (By: Shujaat Abbas)
Relational operators In C language (By: Shujaat Abbas)
 
Learning the C Language
Learning the C LanguageLearning the C Language
Learning the C Language
 
Arithmetic operator
Arithmetic operatorArithmetic operator
Arithmetic operator
 
Learn C
Learn CLearn C
Learn C
 
Types of operators in C
Types of operators in CTypes of operators in C
Types of operators in C
 
Complete C programming Language Course
Complete C programming Language CourseComplete C programming Language Course
Complete C programming Language Course
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
 
Autonomous RC car using gps
Autonomous RC car using gpsAutonomous RC car using gps
Autonomous RC car using gps
 
C++ idioms by example (Nov 2008)
C++ idioms by example (Nov 2008)C++ idioms by example (Nov 2008)
C++ idioms by example (Nov 2008)
 
Advance Microcontroller AVR
Advance Microcontroller AVRAdvance Microcontroller AVR
Advance Microcontroller AVR
 
AVR Fundamentals
AVR FundamentalsAVR Fundamentals
AVR Fundamentals
 
Introduction to AVR Microcontroller
Introduction to AVR Microcontroller Introduction to AVR Microcontroller
Introduction to AVR Microcontroller
 
Arithmetic Logic Unit (ALU)
Arithmetic Logic Unit (ALU)Arithmetic Logic Unit (ALU)
Arithmetic Logic Unit (ALU)
 
AVR Microcontroller
AVR MicrocontrollerAVR Microcontroller
AVR Microcontroller
 
Avr introduction
Avr introductionAvr introduction
Avr introduction
 
Operators in c language
Operators in c languageOperators in c language
Operators in c language
 
AVR programming - BASICS
AVR programming - BASICSAVR programming - BASICS
AVR programming - BASICS
 
Deep C
Deep CDeep C
Deep C
 

Similar to Operators in C Programming

ppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operatorsppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operatorsAmrinder Sidhu
 
PROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptxPROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptxNithya K
 
Fundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariFundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariTHE NORTHCAP UNIVERSITY
 
2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2Don Dooley
 
C Operators and Control Structures.pdf
C Operators and Control Structures.pdfC Operators and Control Structures.pdf
C Operators and Control Structures.pdfMaryJacob24
 
Expressions using operator in c
Expressions using operator in cExpressions using operator in c
Expressions using operator in cSaranya saran
 
Programming Fundamentals lecture 7
Programming Fundamentals lecture 7Programming Fundamentals lecture 7
Programming Fundamentals lecture 7REHAN IJAZ
 
Introduction to programming c and data-structures
Introduction to programming c and data-structures Introduction to programming c and data-structures
Introduction to programming c and data-structures Pradipta Mishra
 
Introduction to programming c and data structures
Introduction to programming c and data structuresIntroduction to programming c and data structures
Introduction to programming c and data structuresPradipta Mishra
 
OPERATORS.pptx
OPERATORS.pptxOPERATORS.pptx
OPERATORS.pptxPMLAVANYA
 
C Operators and Control Structures.pptx
C Operators and Control Structures.pptxC Operators and Control Structures.pptx
C Operators and Control Structures.pptxramanathan2006
 
Sample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.SivakumarSample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.SivakumarSivakumar R D .
 
Operators-computer programming and utilzation
Operators-computer programming and utilzationOperators-computer programming and utilzation
Operators-computer programming and utilzationKaushal Patel
 

Similar to Operators in C Programming (20)

ppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operatorsppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operators
 
PROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptxPROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptx
 
Fundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariFundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan Kumari
 
operators.pptx
operators.pptxoperators.pptx
operators.pptx
 
2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2
 
Operators in c by anupam
Operators in c by anupamOperators in c by anupam
Operators in c by anupam
 
2. operator
2. operator2. operator
2. operator
 
C Operators and Control Structures.pdf
C Operators and Control Structures.pdfC Operators and Control Structures.pdf
C Operators and Control Structures.pdf
 
Theory3
Theory3Theory3
Theory3
 
Expressions using operator in c
Expressions using operator in cExpressions using operator in c
Expressions using operator in c
 
Basic of C Programming | 2022 Updated | By Shamsul H. Ansari
Basic of C Programming | 2022 Updated | By Shamsul H. AnsariBasic of C Programming | 2022 Updated | By Shamsul H. Ansari
Basic of C Programming | 2022 Updated | By Shamsul H. Ansari
 
Programming Fundamentals lecture 7
Programming Fundamentals lecture 7Programming Fundamentals lecture 7
Programming Fundamentals lecture 7
 
Introduction to programming c and data-structures
Introduction to programming c and data-structures Introduction to programming c and data-structures
Introduction to programming c and data-structures
 
Introduction to programming c and data structures
Introduction to programming c and data structuresIntroduction to programming c and data structures
Introduction to programming c and data structures
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Operators1.pptx
Operators1.pptxOperators1.pptx
Operators1.pptx
 
OPERATORS.pptx
OPERATORS.pptxOPERATORS.pptx
OPERATORS.pptx
 
C Operators and Control Structures.pptx
C Operators and Control Structures.pptxC Operators and Control Structures.pptx
C Operators and Control Structures.pptx
 
Sample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.SivakumarSample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.Sivakumar
 
Operators-computer programming and utilzation
Operators-computer programming and utilzationOperators-computer programming and utilzation
Operators-computer programming and utilzation
 

Recently uploaded

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Celine George
 
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.pptxPooja Bhuva
 
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.pptxPooja Bhuva
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxCeline George
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
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.pptxJoelynRubio1
 
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 17Celine George
 
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 17Celine George
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111GangaMaiya1
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesSHIVANANDaRV
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 

Recently uploaded (20)

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
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
 
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
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
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
 
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
 
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
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 

Operators in C Programming

  • 1. OPERATORS N.V.RAJA SEKHAR REDDY C Programming Tutorials www.programming9.com
  • 2. What is an operator?  An operator is a symbol that tells the computer to perform certain mathematical or logical manipulations.  These operators are used in programs to manipulate data and variables. 2 www.programming9.com
  • 3. Types of Operators 1. Arithmetic operators 2. Relational operators 3. Logical operators 4. Assignment operators 5. Increment and decrement operators 6. Conditional operators 7. Bitwise operators 8. Special operators3 www.programming9.com
  • 4. ARITHMETIC OPERATORS:  Arithmetic operators are used to perform numerical calculations among the values. OPERATOR MEANING + Addition - Subtraction * Multiplication / Division % Modulo Division 4 www.programming9.com
  • 5. #include<stdio.h> int main() { int a, b, add, sub, mul, div, rem; printf("Enter a, b values : "); scanf("%d%d",&a,&b); // Reading two values add=a+b; // Addition Operator sub=a-b; // Subtraction Operator mul=a*b; // Multiplication Operator div=a/b; // Division Operator rem=a%b; // Remainder (Modulo) Operator printf("Result of addition is=%dn", add); printf("Result of subtraction=%dn", sub); printf("Result of multiplication is=%dn", mul); printf("Result of division is=%dn", div); printf("Result of remainder=%dn",rem); return 0; } 5 www.programming9.com
  • 6. RELATIONAL OPERATOR:  Relational Operators are used to compare two quantities and take certain decision depending on their relation. If the specified relation is true it returns one. If the specified relation is false it returns zero. OPERATOR MEANING < Is less than <= Is less than or equal to > Is greater than >= Is greater than or equal to == Is equal to != Is not equal to 6 www.programming9.com
  • 7. #include<stdio.h> void main() { int a, b; printf(“Enter values for a and b : "); scanf("%d %d", &a, &b); printf("n The < value of a is %d", a<b); printf("n The <= value of a is %d", a<=b); printf("n The > value of a is %d", a>b); printf("n The >= value of a is %d", a>=b); printf("n The == value of a is %d", a==b); printf("n The != value of a is %d", a!=b); } 7 www.programming9.com Example Program
  • 8. LOGICAL OPERATORS:  These operators are used for testing more than one condition and making decisions. 'c' has three logical operators they are: OPERATOR MEANING && Logical AND || Logical OR ! Logical NOT 8 www.programming9.com
  • 9. Logical Operators Example Program #include<stdio.h> void main() { int a, b; printf(“Enter values for a and b : "); scanf(“%d %d", &a, &b); printf("n %d",(a<b)&&(a!=b)); printf("n %d",(a<b)||(b<a)); printf("n %d",!(a==b)); } 9 www.programming9.com
  • 10. ASSIGNMENT OPERATORS  These operators are used for assigning the result of an expression to a variable.  b=a; OPERATORS: ==, +=, -=, *=, /=, %=, >>=, <<=, &=, |=, ^= 10 www.programming9.com
  • 11. Assignment Operators Example #include<stdio.h> void main() { int a, b, c; printf("Enter the values for a and b : "); scanf("%d %d",&a,&b); printf("n the values of= is:%d",c=a+b); printf("n the values of +=is:%d",c+=b); printf("n the value of-= is:%d",c-=a); printf("n the value of *=is:%d",c*=a); printf("n the value of /=is:%d",c/=b); printf("n the value of %=is:%d",c%=b); } 11 www.programming9.com
  • 12. INCREMENT & DECREMENT OPERATORS Two most useful operators which are present in 'c' are increment and decrement operators. Operators: ++ and -- The operator ++ adds one to the operand The operator -- subtracts one from the operand. Both are unary operators and can be used as pre or post increment/decrement. 12 www.programming9.com
  • 13. INCREMENT & DECREMENT OPERATORS EXAMPLE #include<stdio.h> void main() { int a,b,c; printf("Enter the values for a and b :"); scanf("%d %d", &a, &b); printf("n The value of c is %d", c=++a); printf("n The value of c is %d", c=a++); printf("n The value of c is %d", c=--b); printf("n The value of c is %d", c=b--); } 13 www.programming9.com
  • 14. CONDITIONAL OPERATORS These conditional operator are used to construct conditional expressions of the form. Syntax: exp1?exp2:exp3. where exp1,exp2,exp3 are expressions. Operator: ?: (ternary operator) 14 www.programming9.com
  • 15. Conditional Operators Example #include<stdio.h> void main() { int a, b, x; printf("Enter the values of a add b : "); scanf("%d %d", &a, &b); x=(a>b)?a:b; printf("Biggest Value is :%d",x); } 15 www.programming9.com
  • 16. BITWISE OPERATORS  These operators works on bit level  Applied to Integers only OPERATOR MEANING & Bitwise AND | Bitwise OR ^ Bitwise Exclusive OR << Shift Left >> Shift Right 16 www.programming9.com
  • 17. SPECIAL OPERATORS 'C' supports some special operators such as comma operator, sizeof operator and pointer operators. Comma operator: the comma operator is used to combine related expressions. A comma linked list of expressions are evaluated left to right and the value of right most expression is the value of combined expression.. Example: value=(x=10, y=5, x+y); 17 www.programming9.com
  • 18. Special Operators Contd… Sizeof Operator: Sizeof is an operator used to return the number of bytes the operand occupies. Syntax: m=sizeof(sum); k=sizeof(2351); 18 www.programming9.com