C Program for shutting down the Operating System

#include<stdio.h>
#include<stdlib.h>
int main()
{
//for linux based systems
system("sudo init 0"); //system executes a  shell command.
//for windows
       //system("shutdown -s");
return 0;


}

Comments

Popular posts from this blog

Appending and Prepending in Yocto - +=, =+ vs .=, =.

Connecting Serial ports of two Ubuntu VMWare Virtual Machines

Linux Commands for Hardware Info - lshw, lspci, lsdev, lscpu, lsblk, lsusb