Use the formula of the magnetic moment of a bar magnet.
Step 1: Write the expression of the initial magnetic moment.
We have length =1,
Magnetic moment =M
Therefore M=ml; where m= pole strength
Step 2: Calculate the final magnetic moment.
Now wire of length 1 changes to semicircle (Let radius is r ) therefore 1=πr ⇒r=π1
Now new magnetic moment M′=M×2r=π2ml=πM