C Programming
- Print integer
- Add & subtract
- Odd & even
- Multiply & divide
- Check vowels
- Letter grade program
- Leap year program
- Sum of digits
- Prime numbers
- Sum of numbers
- Find factorial
- Fibonacci series
- Fibonacci triangle
- Number triangle
- Alphabet triangle
- Armstrong numbers
- Palindrome numbers
- Swap number
- Reverse number
- Decimal to binary
- Assembly code in C
- Matrix multiplication
- HCF & LCM
- nCr & nPr
- Print pattern
- Floyd’s triangle
- Pascal triangle
- Count digits
- Strong numbers
- Perfect numbers
- Sum of natural number
- Binary to decimal
- Decimal to octal
- Octal to decimal
- Binary to octal
- Octal to binary
- Add using pointer
- Bubble sort
- Insertion sort
- Selection sort
- Quick sort
- Binary search
- Linear search
- Largest element of array
- Smallest element of array
- Reverse Array
- Variable size & limit
- ASCII value of character
- Sum of array elements
- Number of element in array
- Merge two array
- Insert element in array
- Delete element from array
- Add two matrix
- Transpose matrix
- Print string
- Reverse string
- Delete vowels
- Sort string
- Remove spaces
- Swap string
- Random numbers
- Print date & time
- Print IP address
- Shut down computer
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
Previous page:Â Â Print IP address
Next page:Â Jump to C practice problem solving
Recommended for you: