I want to add just that there is a rule in Arabic to determine (masculine or feminine)
in the sentence according to the counted noun
example; I saw two girls
girls in Arabic is a feminine noun in its singular form
so the number 2 should be feminine
the rule says
if the counted noun are 1,2or 3 [2 girls-1 boy-3 cars]
so the numbers 1,2 or 3 should match the counted noun in its gender
masculine noun =masculine number طفل واحد
feminine noun =feminine number شجرتان اثنتان
example
I saw two girls= noun is 2 and its singular form is feminine so number must be feminine
رأيت فتاتان( اثنتان
I saw two boys=noun is 2 and masculine so number must be masculine
رأيت صبيان(اثنان
while if the noun's number 4,5,6,7,8,9
so the number must be in opposite gender
example;
I saw five men= noun are and 5 masculine so the number its opposite= feminine
رأيت خمسة رجال
خمسة=مؤنث feminine
رجال ----رجل=مذكر masculine
I saw five girls
رأيت خمس بنات
masculine number= خمس=مذكر
بنات----بنت=مؤنث=feminine counted noun
the numbers [10,20......till 100 ] is always same no gender for them
as same as [1000,million,billion...]
I'm sorry if I couldn't explain in a good way
while you are welcome if you need any further explanation or question