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

Modulus Operator:  %

The result of the modulus operator (%) is the remainder when the first operand is divided by the second.

Example

In the following example, the modulus operator is used to determine if the numeric value 4 evenly divides into nCenturyYear. If the remainder is zero, the nCenturyYear must be a leap year, so the LeapYearFunction() is executed.

// Example of the modulus operator
int nCentury;

if ((nCenturyYear % 4) == 0) {
      LeapYearFunction();
}

 

 طباعة المقال العودة إلى  مدرسة الكمبيوتر   قسم البرمجة    الصفحة الأولى
Syria
سورية
Amrit
عمريت
أرواد
طرطوس
صور من طرطوس
صور من سورية
للسيدات فقط
معجم الكمبيوتر
أدب وفكر
المجلة الطبية
المعلومات العامة
لمحة عن طرطوس
الموضة النسائية
مدرسة الكمبيوتر
 © 2002-2012 LBCInformation Corporation. All rights reserved م حنا عطا لحود.