What's new
Guest viewing limit reached
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation
  • Already a member? Click here to login

C program to shutdown your computer

joshua

Emerging Talker
PF Member
Messages
10
Highlights
0
Reaction score
0
Points
35
Peak Coin
0.000000¢
DB Transfer
0.000000¢
#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;
}
 
open a vi editor and copy the pgm,compile it and execute it... i.e All UNIX systems will have vi in some form.
 
System() is function which is used to make system calls(or to execute executable) in c programming but here the path "C:\\WINDOWS\\System32\\shutdown" is path of shutdown.exe of windows platform.
Replace the path with "shutdown -h now" for linux.
i.e system("shutdown -h now");
 
Somebody needs to get stab!

O.k
So what happened was that earlier I was listening to really good music and then.. Snap!
My freaking favorite pair of BEATS PROS break! I'm so mad because out of my whole collection, these were downright my favorite pair. I'm so mad and sad, I feel that someone needs to be stabbed for this!
Here a picture example of my headsets: View attachment 127


Here's what they fully look like ( unbroken )View attachment 128

I'm sad... I am very emotionally connected to my headsets. As a music creator, I should be... but still.. these are NOT easy top obtain around where I live! Anyways, Do you guys have stories of broken collectibles leaving you with broken hearts? :grumpy:
 
Back
Top