Shutdown computer or turn off your computer by C
Page is under construction
In this article we will learn to shutdown computer or turn off our computer using a C program. This program will shut down your computer by calling the system function which will call cmd of your computer or terminal for Linux user.
Warning! save all unsaved file or document before run any program bellow. Because these program will shutdown your computer which results in losing all the unsaved documents.
Shutdown computer program for windows user
If you are a windows user then write the code bellow and run it. This will shut down your computer after 30 seconds.
// code 1
But if you want to shut down your windows machine immediately without waiting 30 seconds, then write the following code and run it.
// code 2
Shutdown computer program for Linux user
If you use Linux operating system then write the following code to shut down your computer.
// code 3
If you want to set a specific time for shutting down your Linux computer then the program will be as like as follows. Here, the time will be considered at minute unit. In the bellow program we have set the shut down timer for our Linux computer after 15 minutes.
// code 4