Answer:
Explanation: Let assume that bars are labeled A and B
Method 1
Using just the identical appearing bar magnet and unmagnetized iron bar.
Place the end of bar A in the middle of bar B.
If bar A sticks to bar B, then bar A is the magnet and bar B the umagnetized iron bar.
If bar A jumps to one of the ends of bar B, then bar B is the magnet.
Reason been that the magnetic field on a bar magnet is greatest at the two poles where the field comes out of the magnet. The center, between the poles, will be the weakest part of the field.
Method 2
Another solution would be to separate the two by quite some distance, float them on a piece of cork/wood in a plastic bucket or suspend them from long strings, then see which one consistently (eventually) lines up tending towards the Earth’s magnetic field.