Do Loop
Do Loop
namespace do_while_loop
{
class Program
{
static void Main(string[] args)
{
int x = 0;
do
{
Console.WriteLine("Hi! Welcome ! There's a lot of FOOD here for
you, please enter the number of the food that you want:");
Console.WriteLine("\n1] HOT-SI-LOG \n2] LONG-SI-LOG \n3] TO-SI-
LOG \n4] SAR - SI - LOG \n5] EXIT");
Console.Write("PLEASE ENTER YOUR ORDER # : ");
int a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
if (a == 1)
{
Console.WriteLine("YOU HAVE ORDERED: 1] - HOTDOG SINANGAG
ITLOG");
Console.WriteLine("THANK YOU FOR COMING! \n");
}
else if (a == 2)
{
Console.WriteLine("YOU HAVE ORDERED: 2] - LONGGANISA SINANGAG
ITLOG");
Console.WriteLine("THANK YOU FOR COMING! \n");
}
else if (a == 3)
{
Console.WriteLine("YOU HAVE ORDERED: 3] - TOCINO SINANGAG
ITLOG");
Console.WriteLine("THANK YOU FOR COMING! \n");
}
else if (a == 4)
{
Console.WriteLine("YOU HAVE ORDERED: 1] - SARDINAS SINANGAG
ITLOG");
Console.WriteLine("THANK YOU FOR COMING! \n");
}
else
{
Console.WriteLine("UWI NA, SA BAHAY NA LANG KUMAIN. ");
Console.WriteLine("THANK YOU FOR USING THIS PROGRAM.
GOODBYE. \n");
break;
}
} while (x <= 5 | x >= 1);
Console.ReadKey();
}