Created
July 7, 2015 22:49
-
-
Save Rodrigo54/2c2ea88f82c8cbe8b756 to your computer and use it in GitHub Desktop.
programa pra desligar pc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
int main(){ | |
char tempo[7], comando[24] = {"shutdown -r -t "}; | |
printf("\nInforme o tempo para reiniciar seu computador em segundos :"); | |
scanf("%s",tempo); //strings não precisam de '&' no scanf. | |
strcat(comando, tempo); | |
printf("\nO tempo determinado para reiniciar o pc sera de %s segundo(s).\n",tempo); | |
printf("\nDigite uma teclar para dar inicio a contagem ..."); | |
getch(); | |
system (comando); | |
printf("\nDentro de %s segundo(s), seu computador será reiniciado.\n",tempo); | |
system("PAUSE"); | |
return(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment