'&&'
The logical-AND operator produces the value 1 if both operands have nonzero
values. If either operand is equal to 0, the result is 0. If the first operand of a
logical-AND operation is equal to 0, the second operand is not evaluated.
'||'
The logical-OR operator performs an inclusive-OR operation on its operands.
The result is 0 if both operands have 0 values. If either operand has a nonzero
value, the result is 1. If the first operand of a logical-OR operation has a nonzero
value, the second operand is not evaluated.
तार्किक-और और तार्किक-या अभिव्यक्ति की ऑपरेंड का मूल्यांकन बाएं से दाएं कर रहे हैं। यदि ऑपरेशन के परिणाम को निर्धारित करने के लिए पहले ऑपरेंड का मूल्य पर्याप्त है, तो दूसरे ऑपरेंड का मूल्यांकन नहीं किया जाता है। इसे "शॉर्ट-सर्किट मूल्यांकन" कहा जाता है। पहले ऑपरेंड के बाद एक अनुक्रम बिंदु है।
धन्यवाद, :)
स्रोत
2012-07-23 18:11:47
वास्तव में, आपकी प्रमुख आवश्यकता क्या है? आप इन चर को असाइन करने जा रहे हैं क्यों? –