Program runs fine but i want it to be able to read an array and store the first 100 prime numbers. Anyone have any idea how?
/*
* Name: Sean
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
//Variables
int value;
//Initialize
Console.WriteLine("Enter Integar: ");
value = Convert.ToInt32(Console.ReadLine());
//Compute
checkForPrime(value);
//Output
//Freeze
Console.ReadKey();
}
public static int checkForPrime(int value)
{
int count;
int count2;
int prime;
for (count = 2; count < value; count++)
{
prime = 1;
for (count2 = 2; count2 < count; count2++)
{
if (count % count2 == 0)
{
prime = 0;
}
}
if (prime == 1)
Console.WriteLine("{0} Is Prime Number", count);
}
return value;
}
}
}