C++ Class 17 What is Operators with Examples सी ++ में ऑपरेटरों की प्राथमिकता ?

30 Просмотры
Издатель
1. PDF File ...................https://drive.google.com/file/d/1uyS-nUmBD_jnSHaMuX83PnEzuuv0Lk7H/view?usp=sharing

C++ Operators with Examples
उदाहरण के साथ C++ ऑपरेटर्स
#Operators _Precedence in C++
(सी ++ में #ऑपरेटरों की #प्राथमिकता)
Operator precedence determines the grouping of terms in an expression. This affects how an expression is evaluated. Certain operators have higher precedence than others; for example, the multiplication operator has higher precedence than the addition operator −
For example x = 7 + 3 * 2; here, x is assigned 13, not 20 because operator * has higher precedence than +, so it first gets multiplied with 3*2 and then adds into 7.
Here, operators with the highest precedence appear at the top of the table, those with the lowest appear at the bottom. Within an expression, higher precedence operators will be evaluated first.
संचालिका पूर्वता एक व्यंजक में पदों के समूहन को निर्धारित करती है। यह प्रभावित करता है कि अभिव्यक्ति का मूल्यांकन कैसे किया जाता है। कुछ ऑपरेटरों की प्राथमिकता दूसरों की तुलना में अधिक होती है; उदाहरण के लिए, गुणन संकारक के पास अतिरिक्त संचालिका की तुलना में उच्च प्राथमिकता है -
उदाहरण के लिए x = 7 + 3 * 2; यहां, x को 13 असाइन किया गया है, 20 नहीं क्योंकि ऑपरेटर * की प्राथमिकता + से अधिक है, इसलिए इसे पहले 3*2 से गुणा किया जाता है और फिर 7 में जोड़ा जाता है। x=7+3*2
X=7+6
X=13
यहां, उच्चतम प्राथमिकता वाले ऑपरेटर तालिका के शीर्ष पर दिखाई देते हैं, सबसे कम वाले ऑपरेटर नीचे दिखाई देते हैं। एक व्यंजक के भीतर, उच्च प्राथमिकता वाले ऑपरेटरों का मूल्यांकन पहले किया जाएगा।

Show Examples
Category Operator Associativity
Postfix () [] -Grater than . ++ - - Left to right
Unary + - ! ~ ++ - - (type)* & sizeof Right to left
Multiplicative * / % Left to right
Additive + - Left to right
Shift Less than Less than Greater than Greater than Left to right
Relational Less than Less than= Greater than Greater than= Left to right
Equality == != Left to right
Bitwise AND & Left to right
Bitwise XOR ^ Left to right
Bitwise OR | Left to right
Logical AND && Left to right
Logical OR || Left to right
Conditional ?: Right to left
Assignment = += -= *= /= %= Greater than Greater than = Less than Less than = &= ^= |= Right to left
Comma , Left to right



#Like and #share #Comment #Subscribe
Thanks for all watching video .
By dharmendra sir 91
Категория
Язык программирования C++
Комментариев нет.