Divisible by both · מתחלק בשניהם
Divisible by both
n is 12. Print yes when n divides exactly by both 3 and 4, and no otherwise.
This is the shape a leap-year test is built from: a remainder question, == 0, and and between two of them. Each side must be a whole question — n % 3 == 0 and n % 4 == 0.
חלקי בשתי
n הוא 12. הדפס yes כאשר n מתחלק במדויק ב-שתי 3 ו4, והדפס no אחרת.
זהו הצורה שממנה נבנה בדיקת שנת פרי: שאלת שארית, == 0, וand בין שתי השאריות. כל צד חייב להיות שאלה שלמה — n % 3 == 0 and n % 4 == 0.
n is 12. Print yes when n divides exactly by both 3 and 4, and no otherwise. · n הוא 12. הדפס yes כאשר n מתחלק במדויק ב-שתי 3 ו4, והדפס no אחרת.
Click Run to see the output here. · לחץ על הרץ כדי לראות את התוצא כאן.