Headlines
Loading...

🎩 Internationalsuperhacker🎩


To shutdown your computer using C program, You'll need to call the system() function which will call the cmd.

stdlib.h contain the system() function and it is used to run any executable file. 


C Program Code - 


#include<stdio.h>

#include<conio.h>

 #include<stdlib.h> 

void main() 

{  

char c;  

printf("Do you want to shutdown your PC/Computer (y/n) : ");  

scanf("%c",&c);  

if(c=='y' || c=='Y')

system("C:\\Windows\\System32\\shutdown /s /t 0"); 

else

printf("You don't wanna shut down your PC/Computer");

getch();

}



Note - Save the file with .c extension. 

/s represents shutdown

/t represents Time means after how much time you wanna shut down your pc. If you will not define the time, By default it will shut down your pc after 30sec.


🔺Share and Support Us Max🔻


➖  ➖

I am a new member of Google bloggers. I am interested to learning knowledge and spread/share my ideas and knowledge in over the world.

0 Comments:

Our Team

  • Muhammad Ali Master / Computers
  • Muhammad IqbalMaster / Computers
  • Shehbaz iqbalMaster / Computers
  • Zoya iqbalMaster / Computers
  • Junaid iqbalMaster / Computers
  • Shahzad IqbalMaster / Computers
  • Copyrights @ Al-Shehbaz-Iqbal-hacker-group