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

Factorial · ⁨المضروب⁩

English

Factorial

The factorial n! is the product 1 * 2 * 3 * ... * n. By definition 0! is 1.

Start a result at 1, then multiply it by every integer from 2 up to n in a loop. (The tests keep n at most 10, so the answer fits in an int.)

العربية

المضروب

المضروب n! هو الجداء 1 * 2 * 3 * ... * n. حسب التعريف 0! هو 1.

ابدأ النتيجة عند 1، ثم اضربها بكل عدد صحيح من 2 حتى n في حلقة. (الاختبارات تحافظ على n بحد أقصى 10، لذا الإجابة تتسع في int.)

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

IGCSE, A-Level & AP