using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(“Please enter your target:”);
int UserTarget = int.Parse(Console.ReadLine());
int Start = 0;
while (Start <= UserTarget)
{
Console.Write(Start + ” “);
Start = Start + 2;
Console.ReadLine();
}
}
}
}
===============
DO WHILE LOOP
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(“Please enter your target:”);
int UserTarget = int.Parse(Console.ReadLine());
string UserChoice = ” “;
int Start = 0;
while (Start <= UserTarget)
{
Console.WriteLine(Start + ” “);
Start = Start + 2;
Console.ReadLine();
}
do
{
Console.WriteLine(“Do you want to continue – Yes or No”);
UserChoice = Console.ReadLine().ToUpper();
if (UserChoice != “Yes” && UserChoice != “No”)
{
Console.WriteLine(“Invalid Choice, Please say Yes or No”,UserChoice);
}
} while (UserChoice != “YES” && UserChoice != “NO”) ;
}while (UserChoice == “YES”);
}
}