Saturday, June 29, 2013

Shut Down your Computer using "C" Programming

/*press y for shutdown your computer (for windows 7).
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
#include <stdio.h>
 #include <stdlib.h>
 
using namespace std;
 
main()
 {
 char ch;
 
printf("Do you want to shutdown your computer now (y/n)\n");
 scanf("%c",&ch);
 
if (ch == 'y' || ch == 'Y')
 system("C:\\WINDOWS\\System32\\shutdown /s");
 
return 0;
 }

No comments:

Post a Comment