#include <windows.h>
int main(){
system("shutdown -s -f -t 00");
}
-s = shutdown.
-f = force.
-t 00 = time in milliseconds before the operation.
____________________________________________
-l = log off
system("shutdown -l -f -t 00");
_________________________
-r = restart.
system("shutdown -r -f -t 00");
:))