X-rays have shorter wavelength than visible light. But that's hardly the reason that they're used for medical imaging. xrays have much higher frequencies then visible light which means they have much greater penetrating ability. with xrays you can see inside the body. you can't do that with a visible flashlight no matter how bright and powerful it is.
Send wave from your location to the object and wait until echo is back.
Measure the time taken.
If you know the speed of wave (say sound wave), than just multiply by half time taken wave to return
The correct answer is true