Hello, I was hoping that I could get some help in finding out how to re-prompt a user with a switch statement menu that I prompted them earlier with. There are 4 options and after the user chooses an option the menu is supposed to pop up again unless the user chooses option 4, how do I do this? For reference I'll put up my source code.
Code:
int main(){
int init_bal,choice,balance,investment, donation;
printf("Welcome!\n");
printf("What is the initial balance of the fund?");
scanf("%d",&init_bal);
printf("What would you like to do?\n");
printf("1 - Make a donation\n");
printf("2 - Make an investment\n");
printf("3 - Print balance of fund\n");
printf("4 - Quit\n");
scanf("%d",&choice);
switch (choice) {
case 1: printf("How much you like to donate?");
scanf("%d",&donation);
balance = donation+init_bal;
case 2: printf("How much would you like to invest?");
scanf("%d", &investment);
if (balance - investment < init_bal)
printf("You cannot make an investment of that amount");
else balance = balance - investment;
}
}