العودة إلى  مدرسة الكمبيوتر   قسم البرمجة    الصفحة الأولى

Logical-AND Operator:  &&

logical-AND-expression :

inclusive-OR-expression
logical-AND-expression && inclusive-OR-expression

The logical operators, logical-AND (&&) and logical-OR (||), are used to combine multiple conditions formed using relational or equality expressions. The logical-AND operator returns the integral value 1 if both operands are nonzero; otherwise, it returns 0. Logical-AND has left-to-right associativity.

Example

In the following example, the logical-AND operator (&&) determines if the account balance is 0 (true) and also if the account is at least three years old (false). Since they are not both true, the ExtendAccount function is not executed.

// Example of the logical-AND operator
int nAccountBalance=0, nAccountYears=1;
 
if ((nAccountBalance == 0) && (nAccountYears > 3)) {
     ExtendAccount();     // so, this function will not execute
}
 
 طباعة المقال العودة إلى  مدرسة الكمبيوتر   قسم البرمجة    الصفحة الأولى
Syria
سورية
Amrit
عمريت
أرواد
طرطوس
صور من طرطوس
صور من سورية
للسيدات فقط
معجم الكمبيوتر
أدب وفكر
المجلة الطبية
المعلومات العامة
لمحة عن طرطوس
الموضة النسائية
مدرسة الكمبيوتر
 © 2002-2012 LBCInformation Corporation. All rights reserved م حنا عطا لحود.