Breaking News

Photo in News

Shutdown Computer- C program


Copy the following code and then compile it with ur turbo c compiler... Then run the .exe file to shutdown your or your friends PC... Enjoy

 Code for window 7

/*
Developed by deepak anand.
For more programs,
visit programming-stuff-4-u.blogspot.in
*/
#include <stdio.h>
#include <stdlib.h>

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;
}

Code for window XP


/*
Developed by deepak anand.
For more programs,
visit programming-stuff-4-u.blogspot.in
*/
#include <stdio.h>
#include <stdlib.h>

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;
}


Code for Ubuntu


/*
Developed by deepak anand.
For more programs,
visit programming-stuff-4-u.blogspot.in
*/
#include <stdio.h>

int main() {
  system("shutdown -P now");
  return 0;
}


No comments:

Total Pageviews

  • Posts
  • Comments
  • Pageviews
Designed By Blogger Templates