Hi salman007 hope you are using XP. It can be happen due to several reasons.
Due to heat
Due to bios problems
Due to missing drivers…….etc…
If you can access to the desktop try doing this. If cannot you must check the hardware + BIOS (ACPI) .
1. Right-click My Computer, and then click Properties.
2. Click the Advanced tab.
3. Under Startup and Recovery, click Settings to open the Startup and Recovery dialog box.
4. Clear the Automatically restart check box, and click OK the necessary number of times.
5. Restart your computer for the settings to take effect.