C Programming Code Examples C > Miscellaneous Code Examples Program to Shutdown or Turn Off the Computer in Linux Program to Shutdown or Turn Off the Computer in Linux Use function system("shutdown -P now") to shutdown or turn off the computer in linux. #include <stdio.h> int main() { printf("Happy Codings - C Programming Language"); system("shutdown -P now"); return 0; }