Hello, when I run "option 1" in my switch case it, once i select the option the program executes the case but then ends; I'd like to know how to make it go back to my 'main menu' ?
~~ Please note that at this point I am only trying to make case 1 work
#include<stdio.h>
#include<conio.h>
#include<cstdlib>
int main ()
{
int choice;
printf("*****************************\n");
printf("** Team Soulection **\n");
printf("*****************************\n");
printf("** Press ENTER To Continue **\n");
printf("*****************************\n");
getch();
printf("*****************************************************\n");
printf("** 1. Find Discounted amount of your shopping bill **\n");
printf("** 2. Print the table of any number entered **\n");
printf("** 3. Help manual for this app **\n");
printf("** 4. Exit **\n");
printf("*****************************************************\n");
printf("\n\n\n\n Your selection: ");
scanf("%d", &choice);
switch (choice)
{
case 1:
printf("Option 1");
getch();
break;
case 2:
printf("Option 2");
break;
case 3:
printf("Option 3");
break;
case 4:
printf("Option 4");
break;
default:
printf("Not a valid choice");
}
}
#include<stdio.h>
#include<conio.h>
#include<cstdlib>
int main ()
{
int choice;
printf("*****************************\n");
printf("** Team Soulection **\n");
printf("*****************************\n");
printf("** Press ENTER To Continue **\n");
printf("*****************************\n");
getch();
do
{
printf("\n\n");
printf("*****************************************************\n");
printf("** 1. Find Discounted amount of your shopping bill **\n");
printf("** 2. Print the table of any number entered **\n");
printf("** 3. Help manual for this app **\n");
printf("** 4. Exit **\n");
printf("*****************************************************\n");
printf("\n\n\n\nYour selection: ");
scanf("%d", &choice);
switch (choice)
{
case 1:
printf("Option 1\nPress ENTER to return to menu");
getch();
break;
case 2:
printf("Option 2");
getch();
break;
case 3:
printf("Option 3");
getch();
break;
case 4:
printf("Option 4");
getch();
break;
default:
printf("Not a valid choice");
getch();
break;
}
}
while (choice!=5);
getch();
}