Shutdown computer using c program


This coding will teach to you how to shutdown windows 7 and windows XP system using c program,this code is well worked on windows 7 and windows xp system,just it will need only turbo c software and type this coding run your program shutdown system

Small Introduction About C language


C programming Language is the base for all programming language.This Language is gives the basics of most programming languages.


Shutdown windows 7 computer using C program


This C program code will use to Shutdown your widows 7 system



#include
#include
#include
void main()
{
char c;
printf("\nDo you want to shutdown your computer:");
scanf("%c",&c);
if(c=='y'||c=='Y')
{
system("C:\\windows\\system32\\shutdown /s");
}
getch();
}


Shutdown windows XP enabled computer using C program



#include
#include
#include
void main()
{
char c;
printf("\nDo you want to shutdown your computer:");
scanf("%c",&c);
if(c=='y'||c=='Y')
{
system("C:\\windows\\system32\\shutdown -s");
}
getch();
}

How to do this


Goto Turbo C and type the above coding and compile and run.This coding is well worked on Windows 7 and Windows XP operating systems


Comments

Author: rajendra prasad01 Sep 2012 Member Level: Silver   Points : 1

Hai Jagadeesh,


As I am new to C software, the code which you had revealed above helps me to go through the c software a step in forward.
I am really thankful to you..

And keep going on. keep some more useful programs like the one above.

Best Regards,

Rajendra Prasad.



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: