Question: in C I need help with a while loop to re-run the program with new input unless the user request to exit the program. in

in C

I need help with a while loop to re-run the program with new input unless the user request to exit the program.

in this the helper function prints the user input in a specific way but that works fine for me I just need to do it again with new values without the program ending.

//helper function

int main()

{

char userInput[60];

printf("Please give me a sentence, or Exit(x): ");

scanf("%[^ ]s",&userInput);

char *x = "x";

char *X = "X";

if (userInput[0] == x[0] || userInput[0] == X[0]){

printf("Exiting!");

printf(" ");

return 0;

}

printf(" ");

helperfunction(userInput);

printf(" ");

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!