Number of ways boys can be arranged = 20!
Since no two girls are allowed to be together, so boys will stand in the following manner,
_B_B_B_B........... (At blank spaces, we can place a girl)
So out of 21 blank spaces we need to arrange 18 girls. So we can do this in ^{21}P_{18 }ways.
So total ways = 20! x ^{21}P_{18 }

Number of ways boys can be arranged = 20!

Since no two girls are allowed to be together, so boys will stand in the following manner,

_B_B_B_B........... (At blank spaces, we can place a girl)

So out of 21 blank spaces we need to arrange 18 girls. So we can do this in

^{21}P_{18 }ways.So total ways = 20! x

^{21}P_{18 }_B1_B2_...._B20_ , in this we are left with 21 places to put girls,

so girls have got 21C18 choices and no.of ways of arranging girls is 18! and boys arranging is 20! ,

so ans becomes

21C18 *18! * 20!._G1B1G2B3

G3_G4....G18_