Sunday, 1 February 2015

Restart PC with C++ Program

Structure of the Problem Requirements

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;
}
}

Output of the Program

Restart PC with C++ Program

Share it Please
asad

About Author!

Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.

0 comments:

Post a Comment