Program c shutdown otomatis

#include <stdio.h>
#include <conio.h>
#include <process.h>
#include <stdlib.h>

void Delay(void);

int main(int argc, char *argv[]) {
int t, i, s;
system(“CLS”);
printf(“Masukkan waktu shutdown (detik) : “);
scanf(“%d”,&t);
for(i = 0; i < t; ++i) {
Delay();
}
s = system(“TSSHUTDN.EXE 0 /DELAY:0 /POWERDOWN”);
printf(“%d”,s); //printf(“Shutting down…………”);
return 0;
}

void Delay(void) {
int i = 0;
while(i < 10000000) {
++i;
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: