With this program a user can restart computer with C++ program . System class is used to restart the computer and we just pass the parameter 'system-r' to system class and this piece of code restart the computer .
Source Code
#include <iostream> #include <windows.h> using namespace std; int main() { char choice ; cout<<" \t \t \t LEP Tutorials \n \n "<<endl; cout<<" Do You Want to Restart PC ? Y/N "<<endl; cout<<" "; cin>>choice; if ((choice =='y' )||(choice =='Y' )) { system("shutdown -r"); } else { return 0; } }
0 comments:
Post a Comment