Hi, @Soujanya,
Windows has its "own" localhost, so you have to "help" it find Ubuntu's one.
In your virtual machine, go to this IP http://10.0.2.2/ and it should work. You can edit the Windows host file to make the localhost point to that IP so you don't have to remember it.
In: C:\Windows\System32\drivers\etc\hosts
Add:
10.0.2.2 localhost