Skip to main content

Posts

Showing posts with the label Programming

Shutdown your PC using C program.

Hi guys all of we know how to shutdown the PC using batch file or by normal method.But have you ever tried to shutdown your PC using C program.If not in this tutorial i am gonna teach you how to shutdown your  PC by writing a simple c program.so lets see how to do this. Steps: 1.Open any c program compiler and copy the below code. Code to shutdown the PC: For windows 7: #include <stdio.h> #include <stdlib.h> #include<conio.h> //optional main() {    char ch;    printf("Do you want to shutdown your system yes or no\n");    scanf("%c",&ch);    if (ch == 'Y' || ch == 'y')       system("C:\\WINDOWS\\System32\\shutdown /s"); // s-shutdown r-restart l-logoff h-hibernate   getch(); // you can use return 0; instead of getch();   } Note:  S-Shutdown. r-Restart. l-Log off. h-Hibernate. It takes 30 seconds to shutdown,But if you want to shutdown immediately use shut...