xxxxxxxxxx
#include <stdlib.h>
system("shutdown -s -t 0"); // Windows
system("shutdown now"); // Unix-like
xxxxxxxxxx
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main()
{
system("c:\\windows\\system32\\shutdown /i");
return 0;
}
xxxxxxxxxx
#include <cstdlib>
int main() {
system("shutdown -h now"); // Shutdown immediately
return 0;
}