How to get distributable exe file in visual studio?

how to get the exe file in visual studio such that it would work in others machine too.

The easiest way is to put it in a ZIP file with the /data directory-tree and the needed DLLs, which are in the build directory where the EXE is built:

fmodex.dll
fmodexL.dll
FreeImage.dll

With those files in the same location as the exe, it should run on others’ computers.