Sunday, 1 February 2015

Log off computer or terminate all programs with C++ program

Structure of the Problem Requirements 

This Program will log off or terminate all programs with C++ code in PC. There are many commands in C++ system class which directly access the computer and make quick change in the system according to the code in program . In this problem we just used the system-f command which log off the system and terminate all the process .

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 ShutDown All the Progrms ? Y/N "<<endl;
cout<<" ";
cin>>choice;
if ((choice =='y' )||(choice =='Y' ))
{
system("shutdown -f");
}
else
{
return 0;
}
}

Output of the Program

Log off computer or terminate all programs 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