I have forgotten my username and password of admin in MarkLogic 5. I tried to uninstall the software MarkLogic 5 and install that again. But every time it is asking for username
The default data directory is under C:\Program Files\MarkLogic. Remove c:\Program Files\MarkLogic\Data directory and start ML, then run MarkLogic Admin url, which will open the url to http://127.0.0.1:8001/ It will ask initial setup. Type your new admin password there, then you will be cool bananas!
Getting past the admin password is supposed to be hard (or impossible), of course. You mentioned uninstalling MarkLogic; if you aren't worried about preserving data, you can uninstall MarkLogic and remove the data directory (/var/opt/MarkLogic on Linux), then when you reinstall you'll be prompted to enter a new admin password.
edit: adding code from Jordan Stewart's comment to provide better formatting:
# stop Marklogic using a service
sudo service MarkLogic stop
# change directories to MarkLogic data dir
cd var/opt/MarkLogic/
# remove everything including folder, this is dangerous
sudo rm -rf *
# start MarkLogic
sudo service MarkLogic start