programming-examples/c++/_Basic/Shutdown Computer.cpp
2019-11-15 12:59:38 +01:00

14 lines
309 B
C++

/* for windows 7 only */
#include < iostream.h >
#include < stdlib.h >
main()
{
char ch;
cout<<"Do you want to shutdown your computer now (y/n)\n";
cin>>ch;
if (ch == 'y' || ch == 'Y')
system("C:\\WINDOWS\\System32\\shutdown /s");
/*shutdown command*/
return 0;
}