SlideShare a Scribd company logo
Shroff S.R. Rotary Institute of Chemical Technology
Principle Supporter & Sponsor-United Phosphorous Ltd(UPL)/Shroff family
Managed By Ankleshwar Rotary Education Society
Approved by AICTE, New Delhi, Govt. of Gujarat & GTU Affiliated
FEATURES OF ‘C’ LANGUAGE
 ‘C’ is a general purpose structure language- the
instruction consist of algebric expression supported
with English keywords such as if, else, for, goto,
continue, break,etc.
 ‘C’ is programming language – it is simple to
implement and highly effective.
 ‘C’ is compatible language- it can run on all machines
right from 8088 to recent machines.
 ‘C’ is a concise language – Only a small set of instructions are
required to get a task done.
 ‘C’ has reach set of built- in functions.
 ‘C’ provides a variety of data types operators and functions
which makes it’s code highly efficient and fast.
 ‘C’ supports pointers which can directly access the adress of
a variable in the computer’s memory.
 ‘C’ has only 32 keywords.
 ‘C’ provides dynamic allocation of memory- This allows to
allocate memory during runtime.
 ‘C’ Provides Modular programming – It is a logical collection
of one or more functions or modules.
 ‘C’ is extensible – it continuously adds the library functions
supported by the C library.
• ‘C’ is middle level language – It provide high level
programming supports as well as low level
programming supports that means assembly
language programming.
Precedence and Associativity
• EACH OF THE C OPERATORS HAVE A PRECEDENCE OR HIERARCHY
ASSOCIATED TO IT THAT DECIDES AMONG THE SET OF OPERATORS
WHICH IS TO BE EVALUATED FIRST OR WHICH SHOULD PRECEDE THE
OTHER.
• THERE ARE DISTINCT LEVELS OF PRECEDENCE.
• THE OPERATOR OF SAME PRECEDENCE ARE EVALUATED EITHER FROM
LEFT TO RIGHT OR RIGHT TO LEFT, DEPENDING ON THE LEVEL. THIS IS
CALLED ASSOCIATIVITY OF OPERATORS.
Operators Category Operators Associativity Level
Unary Operators - ++ -- ! Sizeof(type) Right to Left 1
Arithmetic multiply,divide * / % Left to Right 2
And modulus
Arithmetic add and + - Left to Right 3
Subtrects
Left shift and Right shift << >> Left to Right 4
Relational Operators < <= > >= Left to Right 5
Equality Operators == != Left to Right 6
Bitwise AND & Left to Right 7
Bitwise XOR ^ Left to Right 8
Operators Category Operators Associativity Level
Bitwise OR | Left to Right 9
Logical AND && Left to Right 10
Logical OR || Left to Right 11
Conditional Operator ?: Right to Left 12
Assignment Operator = += -= *= /= %= Right to Left 13
 TYPE CASTING forcefully converts the value of one type
into another type.
 There are two types of the casting :-
1) IMPLICIT TYPE
2) EXPLICIT TYPE
 When compiler automatically convert data type of the data
then it is called as a implicit type conversion.
 When Type casting forcefully converts the value of one type
into another type then it is called as a explicit type conversion.
(type) expression;
x = (int)10.456; //10.456 converts to 10.
int a = 34; z = (float) a; //34 converts to 34.000.
y = (int) a + b; //Result of a+b is converts to integer
AUTOMATIC TYPE CONVERSION :
IT IS ALSO POSSIBLE TO STORE VALUE OF ONE
TYPE INTO A VARIABLE OF ANOTHER TYPE
WITHOUT A CAST i.e. AUTOMATIC CONVERSION.
IT IS POSSIBLE ONLY IF THE DESTINATION
TYPE HAS ENOUGH MEMORY SPACE TO
STORE THE SOURCE VALUE.
WHEN THE OPERAND IN AN EXPRESSION ARE
OF DIFFERENT DATA TYPE, THE LOWER TYPE
IS CONVERTED INTO HIGHER TYPE BEFORE
THE OPERAND PROCEEDS.
IF ONE OPERAND IS FLOATING POINT AND OTHER IS INTEGER , THE
INTEGER IS CONVERTED IN TO FLOATING POINT AND THE RESULT
IS FLOATING POINT.
IF ONE OF THE OPERAND IS LONG DOUBLE, CONVERT THE LONG
DOUBLE AND RESULT IS LONG DOUBLE.
IF ONE OPERAND IS FLOATING POINT AND OTHER IS INTEGER , THE
INTEGER IS CONVERTED IN TO FLOATING POINT AND THE RESULT
IS FLOATING POINT.
IF ONE OF THE OPERAND IS LONG DOUBLE, CONVERT THE LONG
DOUBLE AND RESULT IS LONG DOUBLE.
IN THE FINAL, THE RESULT OF EXPRESSION IS CONVERTED IN
TO THE TYPE OF THE VARIABLES ON THE LEFT OF THE '=' SIGN
AND IN THIS PROCESS THE FOLLOWING CHANGES MAY OCCUR
:
FLOAT TO INT CAUSES TRUNCATION OF THE FRACTIONAL PART
OF ZERO.
DOUBLE TO FLOAT CAUSES ROUNDING OF DIGITS.
EXAMPLES :
int j ;
float k;
j=4.6; //when 4.6 is assigned to j it gets converted in to 4
k=12; //when12 is assigned to k it converts in to 12.000000
EXAMPLE OF TYPE CASTING
 Program to illustrate type casting
 Solution:
Flowchart:
 Algorithm :
 Step 1: num =8.45
 Step 2: Print float value of num
 Step 3: Print integer value of num
 Step 4: Stop procedure
Start
num
=8.45
Print float (num)
int (num)
stop
 /* PROGRAM TO ILLUSTRATE TYPE CASTING */
#INCLUDE<STDIO.H>
MAIN()
{
FLOAT NUM = 8.45;
PRINTF(“VALUE OF NUM = %FN”,NUM);
PRINTF(“VALUE OF NUM ON TYPE CASTING = %DN”, (INT)NUM);
}
 OUTPUT
VALUE OF NUM = 8.450000
VALUE OF NUM OF TYPE CASTING = 8
 Program to illustrate Automatic type conversion
 Algorithm: Flowchart:
step 1: X = 5.4;
step 2: Y = 23;
step 3: Print integer value of X
step 4: Print float value of Y
step 5: top procedure
Start
X = 5.4
Y = 23
Print
Int (X)
Float (Y)
stop
 /* Program to illustrate Automatic type conversion */
#include<stdio.h>
main()
{
int x;
float y;
x = 5.4;
y = 23;
printf(“x = %dn”, x);
printf(“y = %fn”,y);
}
 output
x = 5
y = 23.000000

More Related Content

What's hot

C Operators
C OperatorsC Operators
C Operators
Yash Modi
 
Report on c
Report on cReport on c
Report on c
jasmeen kr
 
Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressions
vishaljot_kaur
 
C# operators
C# operatorsC# operators
Operator in c programming
Operator in c programmingOperator in c programming
Operator in c programming
Manoj Tyagi
 
Operators
OperatorsOperators
Operators
jayesh30sikchi
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++
Praveen M Jigajinni
 
CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++
Pranav Ghildiyal
 
Variables, Data Types, Operator & Expression in c in detail
Variables, Data Types, Operator & Expression in c in detailVariables, Data Types, Operator & Expression in c in detail
Variables, Data Types, Operator & Expression in c in detail
gourav kottawar
 
Type conversion, precedence, associativity in c programming
Type conversion, precedence, associativity in c programmingType conversion, precedence, associativity in c programming
Type conversion, precedence, associativity in c programming
Dhrumil Panchal
 
C – operators and expressions
C – operators and expressionsC – operators and expressions
C – operators and expressions
Chukka Nikhil Chakravarthy
 
Operator of C language
Operator of C languageOperator of C language
Operator of C language
Kritika Chauhan
 
Conditional operators
Conditional operatorsConditional operators
Conditional operators
BU
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
programming9
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++
bajiajugal
 
Arithmetic operator
Arithmetic operatorArithmetic operator
Arithmetic operator
Jordan Delacruz
 
Operators
OperatorsOperators
Operators in C & C++ Language
Operators in C & C++ LanguageOperators in C & C++ Language
Operators in C & C++ Language
PreSolutions Softwares
 
ppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operatorsppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operators
Amrinder Sidhu
 
Expressions in c++
 Expressions in c++ Expressions in c++
Expressions in c++
zeeshan turi
 

What's hot (20)

C Operators
C OperatorsC Operators
C Operators
 
Report on c
Report on cReport on c
Report on c
 
Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressions
 
C# operators
C# operatorsC# operators
C# operators
 
Operator in c programming
Operator in c programmingOperator in c programming
Operator in c programming
 
Operators
OperatorsOperators
Operators
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++
 
CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++
 
Variables, Data Types, Operator & Expression in c in detail
Variables, Data Types, Operator & Expression in c in detailVariables, Data Types, Operator & Expression in c in detail
Variables, Data Types, Operator & Expression in c in detail
 
Type conversion, precedence, associativity in c programming
Type conversion, precedence, associativity in c programmingType conversion, precedence, associativity in c programming
Type conversion, precedence, associativity in c programming
 
C – operators and expressions
C – operators and expressionsC – operators and expressions
C – operators and expressions
 
Operator of C language
Operator of C languageOperator of C language
Operator of C language
 
Conditional operators
Conditional operatorsConditional operators
Conditional operators
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++
 
Arithmetic operator
Arithmetic operatorArithmetic operator
Arithmetic operator
 
Operators
OperatorsOperators
Operators
 
Operators in C & C++ Language
Operators in C & C++ LanguageOperators in C & C++ Language
Operators in C & C++ Language
 
ppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operatorsppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operators
 
Expressions in c++
 Expressions in c++ Expressions in c++
Expressions in c++
 

Similar to Precedence and associativity (Computer programming and utilization)

C programming language
C programming languageC programming language
C programming language
Abin Rimal
 
C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C language
Rakesh Roshan
 
CP Handout#3
CP Handout#3CP Handout#3
CP Handout#3
trupti1976
 
C programming
C programming C programming
C programming
DipjualGiri1
 
C program
C programC program
C program
AJAL A J
 
Type casting in c programming
Type casting in c programmingType casting in c programming
Type casting in c programming
Rumman Ansari
 
Kuliah komputer pemrograman
Kuliah  komputer pemrogramanKuliah  komputer pemrograman
Kuliah komputer pemrograman
hardryu
 
Programming
ProgrammingProgramming
Programming
Sean Chia
 
Type Conversion Elimination by Dominant Flow Analysis
Type Conversion Elimination by Dominant Flow AnalysisType Conversion Elimination by Dominant Flow Analysis
Type Conversion Elimination by Dominant Flow Analysis
inventionjournals
 
1. overview of c
1. overview of c1. overview of c
1. overview of c
amar kakde
 
Type casting &amp; type conversion
Type casting &amp; type conversionType casting &amp; type conversion
Type casting &amp; type conversion
Digvijaysinh Gohil
 
C notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semC notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-sem
Kavita Dagar
 
data type.pptxddddswwyertr hai na ki extend kr de la
data type.pptxddddswwyertr hai na ki extend kr de ladata type.pptxddddswwyertr hai na ki extend kr de la
data type.pptxddddswwyertr hai na ki extend kr de la
LEOFAKE
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction tools
sunilchute1
 
C C++ tutorial for beginners- tibacademy.in
C C++ tutorial for beginners- tibacademy.inC C++ tutorial for beginners- tibacademy.in
C C++ tutorial for beginners- tibacademy.in
TIB Academy
 
Algorithm and flowchart.pptx
Algorithm and flowchart.pptxAlgorithm and flowchart.pptx
Algorithm and flowchart.pptx
MaheShiva
 
Pc module1
Pc module1Pc module1
Pc module1
SANTOSH RATH
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
Likhil181
 
presentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptxpresentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptx
KrishanPalSingh39
 
C programming session3
C programming  session3C programming  session3
C programming session3
Keroles karam khalil
 

Similar to Precedence and associativity (Computer programming and utilization) (20)

C programming language
C programming languageC programming language
C programming language
 
C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C language
 
CP Handout#3
CP Handout#3CP Handout#3
CP Handout#3
 
C programming
C programming C programming
C programming
 
C program
C programC program
C program
 
Type casting in c programming
Type casting in c programmingType casting in c programming
Type casting in c programming
 
Kuliah komputer pemrograman
Kuliah  komputer pemrogramanKuliah  komputer pemrograman
Kuliah komputer pemrograman
 
Programming
ProgrammingProgramming
Programming
 
Type Conversion Elimination by Dominant Flow Analysis
Type Conversion Elimination by Dominant Flow AnalysisType Conversion Elimination by Dominant Flow Analysis
Type Conversion Elimination by Dominant Flow Analysis
 
1. overview of c
1. overview of c1. overview of c
1. overview of c
 
Type casting &amp; type conversion
Type casting &amp; type conversionType casting &amp; type conversion
Type casting &amp; type conversion
 
C notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semC notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-sem
 
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
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction tools
 
C C++ tutorial for beginners- tibacademy.in
C C++ tutorial for beginners- tibacademy.inC C++ tutorial for beginners- tibacademy.in
C C++ tutorial for beginners- tibacademy.in
 
Algorithm and flowchart.pptx
Algorithm and flowchart.pptxAlgorithm and flowchart.pptx
Algorithm and flowchart.pptx
 
Pc module1
Pc module1Pc module1
Pc module1
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
 
presentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptxpresentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptx
 
C programming session3
C programming  session3C programming  session3
C programming session3
 

More from Digvijaysinh Gohil

Hydraulic cranes
Hydraulic cranesHydraulic cranes
Hydraulic cranes
Digvijaysinh Gohil
 
Hydraulic braking systems
Hydraulic braking systemsHydraulic braking systems
Hydraulic braking systems
Digvijaysinh Gohil
 
Human resources management
Human resources managementHuman resources management
Human resources management
Digvijaysinh Gohil
 
Traits of a good listner (Communication Skills)
Traits of a good listner (Communication Skills)Traits of a good listner (Communication Skills)
Traits of a good listner (Communication Skills)
Digvijaysinh Gohil
 
Techniques of reading (Communication Skills)
Techniques of reading (Communication Skills)Techniques of reading (Communication Skills)
Techniques of reading (Communication Skills)
Digvijaysinh Gohil
 
Proxemics (Communication Skills)
Proxemics (Communication Skills)Proxemics (Communication Skills)
Proxemics (Communication Skills)
Digvijaysinh Gohil
 
Proxemics (2) (Communication Skills)
Proxemics (2) (Communication Skills)Proxemics (2) (Communication Skills)
Proxemics (2) (Communication Skills)
Digvijaysinh Gohil
 
Paralinguistic (Communication Skills)
Paralinguistic (Communication Skills)Paralinguistic (Communication Skills)
Paralinguistic (Communication Skills)
Digvijaysinh Gohil
 
Paralinguistic (2) (Communication Skills)
Paralinguistic (2) (Communication Skills)Paralinguistic (2) (Communication Skills)
Paralinguistic (2) (Communication Skills)
Digvijaysinh Gohil
 
Paralinguistic (1) (Communication Skills)
Paralinguistic (1) (Communication Skills)Paralinguistic (1) (Communication Skills)
Paralinguistic (1) (Communication Skills)
Digvijaysinh Gohil
 
Organizing a contents &amp; preparing an outline
Organizing a contents &amp; preparing an outlineOrganizing a contents &amp; preparing an outline
Organizing a contents &amp; preparing an outline
Digvijaysinh Gohil
 
Organizing a contents &amp; preparing an outline (2)
Organizing a contents &amp; preparing an outline (2)Organizing a contents &amp; preparing an outline (2)
Organizing a contents &amp; preparing an outline (2)
Digvijaysinh Gohil
 
Kinesics (Communication Skills)
Kinesics (Communication Skills)Kinesics (Communication Skills)
Kinesics (Communication Skills)
Digvijaysinh Gohil
 
Kinesics (3) (Communication Skills)
Kinesics (3) (Communication Skills)Kinesics (3) (Communication Skills)
Kinesics (3) (Communication Skills)
Digvijaysinh Gohil
 
Kinesics (2) (Communication Skills)
Kinesics (2) (Communication Skills)Kinesics (2) (Communication Skills)
Kinesics (2) (Communication Skills)
Digvijaysinh Gohil
 
Introduction to communication (Communication Skills)
Introduction to communication (Communication Skills)Introduction to communication (Communication Skills)
Introduction to communication (Communication Skills)
Digvijaysinh Gohil
 
Email etiquette (Communication Skills)
Email etiquette (Communication Skills)Email etiquette (Communication Skills)
Email etiquette (Communication Skills)
Digvijaysinh Gohil
 
Welded joints (machine design & industrial drafting )
Welded joints (machine design & industrial drafting )Welded joints (machine design & industrial drafting )
Welded joints (machine design & industrial drafting )
Digvijaysinh Gohil
 
Types of stresses and theories of failure (machine design & industrial drafti...
Types of stresses and theories of failure (machine design & industrial drafti...Types of stresses and theories of failure (machine design & industrial drafti...
Types of stresses and theories of failure (machine design & industrial drafti...
Digvijaysinh Gohil
 
Treaded joint (machine design & industrial drafting )
Treaded joint (machine design & industrial drafting )Treaded joint (machine design & industrial drafting )
Treaded joint (machine design & industrial drafting )
Digvijaysinh Gohil
 

More from Digvijaysinh Gohil (20)

Hydraulic cranes
Hydraulic cranesHydraulic cranes
Hydraulic cranes
 
Hydraulic braking systems
Hydraulic braking systemsHydraulic braking systems
Hydraulic braking systems
 
Human resources management
Human resources managementHuman resources management
Human resources management
 
Traits of a good listner (Communication Skills)
Traits of a good listner (Communication Skills)Traits of a good listner (Communication Skills)
Traits of a good listner (Communication Skills)
 
Techniques of reading (Communication Skills)
Techniques of reading (Communication Skills)Techniques of reading (Communication Skills)
Techniques of reading (Communication Skills)
 
Proxemics (Communication Skills)
Proxemics (Communication Skills)Proxemics (Communication Skills)
Proxemics (Communication Skills)
 
Proxemics (2) (Communication Skills)
Proxemics (2) (Communication Skills)Proxemics (2) (Communication Skills)
Proxemics (2) (Communication Skills)
 
Paralinguistic (Communication Skills)
Paralinguistic (Communication Skills)Paralinguistic (Communication Skills)
Paralinguistic (Communication Skills)
 
Paralinguistic (2) (Communication Skills)
Paralinguistic (2) (Communication Skills)Paralinguistic (2) (Communication Skills)
Paralinguistic (2) (Communication Skills)
 
Paralinguistic (1) (Communication Skills)
Paralinguistic (1) (Communication Skills)Paralinguistic (1) (Communication Skills)
Paralinguistic (1) (Communication Skills)
 
Organizing a contents &amp; preparing an outline
Organizing a contents &amp; preparing an outlineOrganizing a contents &amp; preparing an outline
Organizing a contents &amp; preparing an outline
 
Organizing a contents &amp; preparing an outline (2)
Organizing a contents &amp; preparing an outline (2)Organizing a contents &amp; preparing an outline (2)
Organizing a contents &amp; preparing an outline (2)
 
Kinesics (Communication Skills)
Kinesics (Communication Skills)Kinesics (Communication Skills)
Kinesics (Communication Skills)
 
Kinesics (3) (Communication Skills)
Kinesics (3) (Communication Skills)Kinesics (3) (Communication Skills)
Kinesics (3) (Communication Skills)
 
Kinesics (2) (Communication Skills)
Kinesics (2) (Communication Skills)Kinesics (2) (Communication Skills)
Kinesics (2) (Communication Skills)
 
Introduction to communication (Communication Skills)
Introduction to communication (Communication Skills)Introduction to communication (Communication Skills)
Introduction to communication (Communication Skills)
 
Email etiquette (Communication Skills)
Email etiquette (Communication Skills)Email etiquette (Communication Skills)
Email etiquette (Communication Skills)
 
Welded joints (machine design & industrial drafting )
Welded joints (machine design & industrial drafting )Welded joints (machine design & industrial drafting )
Welded joints (machine design & industrial drafting )
 
Types of stresses and theories of failure (machine design & industrial drafti...
Types of stresses and theories of failure (machine design & industrial drafti...Types of stresses and theories of failure (machine design & industrial drafti...
Types of stresses and theories of failure (machine design & industrial drafti...
 
Treaded joint (machine design & industrial drafting )
Treaded joint (machine design & industrial drafting )Treaded joint (machine design & industrial drafting )
Treaded joint (machine design & industrial drafting )
 

Recently uploaded

Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
gowrishankartb2005
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
zubairahmad848137
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
mamamaam477
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
LAXMAREDDY22
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
KrishnaveniKrishnara1
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
amsjournal
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
Roger Rozario
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 

Precedence and associativity (Computer programming and utilization)

  • 1. Shroff S.R. Rotary Institute of Chemical Technology Principle Supporter & Sponsor-United Phosphorous Ltd(UPL)/Shroff family Managed By Ankleshwar Rotary Education Society Approved by AICTE, New Delhi, Govt. of Gujarat & GTU Affiliated
  • 3.  ‘C’ is a general purpose structure language- the instruction consist of algebric expression supported with English keywords such as if, else, for, goto, continue, break,etc.  ‘C’ is programming language – it is simple to implement and highly effective.  ‘C’ is compatible language- it can run on all machines right from 8088 to recent machines.
  • 4.  ‘C’ is a concise language – Only a small set of instructions are required to get a task done.  ‘C’ has reach set of built- in functions.  ‘C’ provides a variety of data types operators and functions which makes it’s code highly efficient and fast.  ‘C’ supports pointers which can directly access the adress of a variable in the computer’s memory.
  • 5.  ‘C’ has only 32 keywords.  ‘C’ provides dynamic allocation of memory- This allows to allocate memory during runtime.  ‘C’ Provides Modular programming – It is a logical collection of one or more functions or modules.  ‘C’ is extensible – it continuously adds the library functions supported by the C library.
  • 6. • ‘C’ is middle level language – It provide high level programming supports as well as low level programming supports that means assembly language programming.
  • 7. Precedence and Associativity • EACH OF THE C OPERATORS HAVE A PRECEDENCE OR HIERARCHY ASSOCIATED TO IT THAT DECIDES AMONG THE SET OF OPERATORS WHICH IS TO BE EVALUATED FIRST OR WHICH SHOULD PRECEDE THE OTHER. • THERE ARE DISTINCT LEVELS OF PRECEDENCE. • THE OPERATOR OF SAME PRECEDENCE ARE EVALUATED EITHER FROM LEFT TO RIGHT OR RIGHT TO LEFT, DEPENDING ON THE LEVEL. THIS IS CALLED ASSOCIATIVITY OF OPERATORS.
  • 8. Operators Category Operators Associativity Level Unary Operators - ++ -- ! Sizeof(type) Right to Left 1 Arithmetic multiply,divide * / % Left to Right 2 And modulus Arithmetic add and + - Left to Right 3 Subtrects Left shift and Right shift << >> Left to Right 4 Relational Operators < <= > >= Left to Right 5 Equality Operators == != Left to Right 6 Bitwise AND & Left to Right 7 Bitwise XOR ^ Left to Right 8
  • 9. Operators Category Operators Associativity Level Bitwise OR | Left to Right 9 Logical AND && Left to Right 10 Logical OR || Left to Right 11 Conditional Operator ?: Right to Left 12 Assignment Operator = += -= *= /= %= Right to Left 13
  • 10.  TYPE CASTING forcefully converts the value of one type into another type.  There are two types of the casting :- 1) IMPLICIT TYPE 2) EXPLICIT TYPE
  • 11.  When compiler automatically convert data type of the data then it is called as a implicit type conversion.  When Type casting forcefully converts the value of one type into another type then it is called as a explicit type conversion.
  • 12. (type) expression; x = (int)10.456; //10.456 converts to 10. int a = 34; z = (float) a; //34 converts to 34.000. y = (int) a + b; //Result of a+b is converts to integer
  • 13. AUTOMATIC TYPE CONVERSION : IT IS ALSO POSSIBLE TO STORE VALUE OF ONE TYPE INTO A VARIABLE OF ANOTHER TYPE WITHOUT A CAST i.e. AUTOMATIC CONVERSION.
  • 14. IT IS POSSIBLE ONLY IF THE DESTINATION TYPE HAS ENOUGH MEMORY SPACE TO STORE THE SOURCE VALUE. WHEN THE OPERAND IN AN EXPRESSION ARE OF DIFFERENT DATA TYPE, THE LOWER TYPE IS CONVERTED INTO HIGHER TYPE BEFORE THE OPERAND PROCEEDS.
  • 15. IF ONE OPERAND IS FLOATING POINT AND OTHER IS INTEGER , THE INTEGER IS CONVERTED IN TO FLOATING POINT AND THE RESULT IS FLOATING POINT. IF ONE OF THE OPERAND IS LONG DOUBLE, CONVERT THE LONG DOUBLE AND RESULT IS LONG DOUBLE. IF ONE OPERAND IS FLOATING POINT AND OTHER IS INTEGER , THE INTEGER IS CONVERTED IN TO FLOATING POINT AND THE RESULT IS FLOATING POINT. IF ONE OF THE OPERAND IS LONG DOUBLE, CONVERT THE LONG DOUBLE AND RESULT IS LONG DOUBLE.
  • 16. IN THE FINAL, THE RESULT OF EXPRESSION IS CONVERTED IN TO THE TYPE OF THE VARIABLES ON THE LEFT OF THE '=' SIGN AND IN THIS PROCESS THE FOLLOWING CHANGES MAY OCCUR : FLOAT TO INT CAUSES TRUNCATION OF THE FRACTIONAL PART OF ZERO. DOUBLE TO FLOAT CAUSES ROUNDING OF DIGITS.
  • 17. EXAMPLES : int j ; float k; j=4.6; //when 4.6 is assigned to j it gets converted in to 4 k=12; //when12 is assigned to k it converts in to 12.000000
  • 18. EXAMPLE OF TYPE CASTING  Program to illustrate type casting  Solution: Flowchart:  Algorithm :  Step 1: num =8.45  Step 2: Print float value of num  Step 3: Print integer value of num  Step 4: Stop procedure Start num =8.45 Print float (num) int (num) stop
  • 19.  /* PROGRAM TO ILLUSTRATE TYPE CASTING */ #INCLUDE<STDIO.H> MAIN() { FLOAT NUM = 8.45; PRINTF(“VALUE OF NUM = %FN”,NUM); PRINTF(“VALUE OF NUM ON TYPE CASTING = %DN”, (INT)NUM); }  OUTPUT VALUE OF NUM = 8.450000 VALUE OF NUM OF TYPE CASTING = 8
  • 20.  Program to illustrate Automatic type conversion  Algorithm: Flowchart: step 1: X = 5.4; step 2: Y = 23; step 3: Print integer value of X step 4: Print float value of Y step 5: top procedure Start X = 5.4 Y = 23 Print Int (X) Float (Y) stop
  • 21.  /* Program to illustrate Automatic type conversion */ #include<stdio.h> main() { int x; float y; x = 5.4; y = 23; printf(“x = %dn”, x); printf(“y = %fn”,y); }  output x = 5 y = 23.000000