#include #include int main() { std::cout << "Enter '1' to shut down or '2' to restart your computer: "; int choice; std::cin >> choice; switch (choice) { case 1: // Shut down the computer std::cout << "Shutting down your computer..." << std::endl; Sleep(1000); // Sleep for 1 second to give the user a chance to see the message ExitWindowsEx(EWX_SHUTDOWN, 0); break; case 2: // Restart the computer std::cout << "Restarting your computer..." << std::endl; Sleep(1000); // Sleep for 1 second to give the user a chance to see the message ExitWindowsEx(EWX_REBOOT, 0); break; default: // Invalid input std::cout << "Invalid choice. Please try again." << std::endl; break; } return 0; }