SlideShare a Scribd company logo
1 of 21
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

Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressionsvishaljot_kaur
 
Operator in c programming
Operator in c programmingOperator in c programming
Operator in c programmingManoj Tyagi
 
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 detailgourav 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 programmingDhrumil Panchal
 
Conditional operators
Conditional operatorsConditional operators
Conditional operatorsBU
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programmingprogramming9
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++bajiajugal
 
ppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operatorsppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operatorsAmrinder 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 languageAbin 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 languageRakesh Roshan
 
Type casting in c programming
Type casting in c programmingType casting in c programming
Type casting in c programmingRumman Ansari
 
Kuliah komputer pemrograman
Kuliah  komputer pemrogramanKuliah  komputer pemrograman
Kuliah komputer pemrogramanhardryu
 
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 Analysisinventionjournals
 
1. overview of c
1. overview of c1. overview of c
1. overview of camar kakde
 
Type casting &amp; type conversion
Type casting &amp; type conversionType casting &amp; type conversion
Type casting &amp; type conversionDigvijaysinh Gohil
 
C notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semC notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semKavita 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 laLEOFAKE
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction toolssunilchute1
 
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.inTIB Academy
 
Algorithm and flowchart.pptx
Algorithm and flowchart.pptxAlgorithm and flowchart.pptx
Algorithm and flowchart.pptxMaheShiva
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxLikhil181
 
presentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptxpresentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptxKrishanPalSingh39
 

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

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 outlineDigvijaysinh 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

Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 

Recently uploaded (20)

Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 

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