Write a C program to Perform Operator Precedence. Here’s a Simple Program for implementing or perform operator precedence C Programming Language.
The C language standard doesn’t specify operator precedence. It specifies the language grammar, and the precedence table is derived from it to simplify understanding.
Operator Precedence :
Operator precedence & associativity table
Operator precedence & associativity are listed in the following table and this table is summarized in decreasing Order of priority i.e topmost operator has highest priority and bottommost operator has Lowest Priority.
OPERATOR
ASSOCIATIVITY
[ ].
->
++ –
Brackets (array subscript)
Member selection via object name
Member selection via pointer
Postfix increment/decrement (see Note 2)
left-to-right
+ –
! ~
(type)
*
&
sizeof
Unary plus/minus
Logical negation/bitwise complement
Cast (convert value to temporary value of type)
Dereference
Address (of operand)
Determine size in bytes on this implementation
> >=
Relational greater than/greater than or equal to
+= -=
*= /=
%= &=
^= |=
<<= >>=
Addition/subtraction assignment
Multiplication/division assignment
Modulus/bitwise AND assignment
Bitwise exclusive/inclusive OR assignment
Bitwise shift left/right assignment
,
Below is the source code for C Program to input values into an array and display them which is successfully compiled and run on Windows System to produce desired output as shown below :
SOURCE CODE : :
OUTPUT : :
need an explanation for this answer? contact us directly to get an explanation for this answer