how do I return back in a menu

Viewed 47

Ok, so I am practicing programming by creating a restaurant project. when a user chooses an option (food for example) I add the price to the total variable, then I want to return back to the main menu. How do I exit the switch without stopping the program?

here is the snippet

switch (option)
    {
    case 1:
        listFood();

        scanf("%d", &option);
        switch (option)
        {
        case 1:
            puts("Pizza Added To Cart");
            total = total + pizza; // after this how do i return to the menu ?
            break;

0 Answers
Related