This program is modification/implementation of last program "of shutdown your computer through programming"
.
.
.
#include<windows.h>
#include<iostream>
using namespace std;
int main()
{
int x;
cout<<"x=1-shutdown\n";
cout<<"x=2-logoff\n";
cout<<"x=3-restart\n";
cout<<"x=4-hibbernet\n";
cin>>x;
switch(x)
{
case 1: system("shutdown/s");
break;
case 2: system("shutdown/l");
break;
case 3: system("shutdown/r");
break;
case 4: system("shutdown/h");
break;
}
return 0;
}
.
.
.
#include<windows.h>
#include<iostream>
using namespace std;
int main()
{
int x;
cout<<"x=1-shutdown\n";
cout<<"x=2-logoff\n";
cout<<"x=3-restart\n";
cout<<"x=4-hibbernet\n";
cin>>x;
switch(x)
{
case 1: system("shutdown/s");
break;
case 2: system("shutdown/l");
break;
case 3: system("shutdown/r");
break;
case 4: system("shutdown/h");
break;
}
return 0;
}