Introduction
In this blog we have created a Simple C# Console Application that accepts Range from
the user and gives prime no's from the given range.
Step 1: Create New Console Application in Visual Studio 2010.
File Menu -> New ->New Project -> Console Application
Step 2: Write the Following Code in "Program.cs" File.
Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PrimeNo_C
{
class Program
{
static void Main(string[] args)
{
int st, en, cnt = 0;
Console.WriteLine("Starting Value:-");
st = int.Parse(Console.ReadLine());


SanthoshPosted Jul 27, 2016, 6:53 AM
Small correction yaar....We must check with starting range.. in first for loop for (int i = st; i < en; i++)... this gives you the right output