The correct option is B 24 km/h
While going from A to B, let the speed be V1 and from B to A the speed be V2.
V1=20 km/h
V2=30 km/h
If d be the distance AB. Then we can say:
Time required for A to B=t1=dV1
Time required for B to A=t2=dV2
Average speed, v=total distancetotal time
v=d+dt1+t2
v=2ddV1+dV2
v=2V1V2V1+V2
v=2×20×3020+30
⇒v=24 km/h