I tried the PRAM many times and it didn't work. Thank you Reve. Your link solution was the one that worked. Dunno why your solution was down voted.
I am copy pasting the text:
In the three years of using my MacBook Air, I have never had any major problems with it. It was totally reliable, even after I accidentally spilled coffee on it. However, the update to macOS Sierra 10.12.2 ruined its streak, leaving me with a blank screen that only displayed the cursor.
I initially blamed the update for this, but after I saw no similar reports from other users I started doing some digging. As it turns out, this problem predates Sierra by a couple of years. Apple has not addressed it yet, but, don’t panic: it is pretty easy to fix it yourself.
It is not clear what exactly is causing macOS to act up after installing an update, but it rears its ugly head after powering on the Mac. You can try to reboot or reset the PRAM and SMC — the first things that Mac users can try when something isn’t working right — but that will not fix it.
So, here is what you need to do. First, you need to shut down your Mac, if it’s powered on. Pressing the power key for a couple of seconds will do the trick.
Next, you have to boot your Mac in single-user mode. That’s done by pressing the Command and S keys at the same time, right after pressing the power key. If you did it right, you should see a whole bunch of lines on the screen in what is a Terminal-like interface.
(I’ve seen someone recommend that you reset the PRAM three times before booting in the single-user mode. There is no harm in doing that. Hit the Command, Option, P and R keys at the same time, right after you power it on, and wait until you hear the startup chime for the third time before letting go. Then, quickly press the Command and S keys, to get you into the single-user mode.)
You then need to type the following commands:
/sbin/mount -uw /
rm -f /Library/Preferences/com.apple.loginwindow.plist
rm -f /var/db/.AppleUpgrade
You will have to press the Enter/Return key after each one. The fifth command restarts your Mac. It will show the login screen. That’s normal, even if you previously bypassed it. Type in your password and you’re back in business.
You may run into this problem even after macOS Sierra 10.12.2, but know that you will be able to apply this method again if that happens.