I'm trying to get a C program to repeat itself when the user selects from an option at the end of the algorithm. This algorithm uses functions for most of the main body of it.

example:

code starts:

greeting
calculation
answer

Would you like to find another answer (y or n)?

code ends:

I've been trying to use a while loop of "while (choice == 'y')" but when I put it before the actual calculation it simply skips over the while to the end of the program. The problem is I don't know how to get the program to repeat itself when the option is at the end.

Any help anyone could provide would be appreciated.