Today I’m gonna share a small piece of c program to shutdown computer. It won’t take more than a minute to code and compile it. Moreover a newbie C programmer who knows some basics in C program can understand this program.
You may also like Top 25+ Websites to Learn Programming Online
Below is the source code to shutdown computer using C Program
1 2 3 4 5 6 7 8 |
#include<stdio.h> #include<process.h> #include<windows.h> int main() { system(“shutdown -s -t 30″); return 0; } |
I tried this code in Dev C++ and its working for me.
Note : When you compile and run this program it will only show empty screen and system won’t shutdown. You need to open compile file (filename.exe) directly
How about you?
Did you tried this code?
Any suggestions?
Come and share your thoughts in commends below.
i m very existed for programming m expert in c language and m 17 years old………….
Thanks for coming by and commending 🙂
Thanks.As i am learning C.This is very informative.Keep it up:-)
Hi Gowtham,
I’m so glad that you like this article. Do visit us again 🙂
Am glad that i can now learn programming on my own, thax
Very informative post indeed.. your post helped me a lot!
Just needed to do that for a small project of mine. You’re a life-saver dude!
Can i get source code to shutdown pc from android ?
I’m not sure about it.
Most probably you can do it.