Skip to content · ⁨الانتقال إلى المحتوى⁩

How many halvings? · ⁨كم عدد القسومات؟⁩

English

How many halvings?

n starts at 40. Halve it with n = n // 2 until it reaches 0, counting the steps in steps.

// divides and throws the remainder away, so 5 // 2 is 2. Counting how many times a loop went round needs its own variable, going up by one each turn.

العربية

كم عدد القسومات؟

يبدأ n عند 40. قسّمه بـ n = n // 2 حتى يصل إلى 0، عِدّ الخطوات في steps.

يقسم // ويتخلص من الباقي، لذا 5 // 2 هي 2. عدّ كم مرة دارت الحلقة يتطلب متغيراً خاصاً، يزيد بمقدار واحد في كل دورة.

Log in or create account · ⁨تسجيل الدخول أو إنشاء حساب⁩

IGCSE, A-Level & AP