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 .=, =.

Linux driver example for Per CPU Variable

ARM interview questions