#include main() { int i, res; char commandString[128]; char command[128]; char arguments[128]; for (i=0; i < 5; i++) { printf("Grock- "); fgets(commandString, sizeof(commandString), stdin); res = sscanf(commandString, "%s %[^\n]s", &command, &arguments); if (res > 0) { printf("Command entered: %s\n", command); if (res > 1) printf("Arguments entered: %s\n", arguments); else printf("Arguments entered: \n"); } else { printf("Command entered: \n"); printf("Arguments entered: \n"); } } }