Still hvaing a tiny bit of trouble. If I put the new for-loop in the one with the array, I cannot get through the array properly, and if I put it out of the loop, it doesnt recognise 'i'.
After all this, im guessing the actual code is pretty simple. Bit down that I am not getting it though.
Am I Ready?
I cant do it
I think i am going to have to give up on it.
Although this will give me completely random numbers:
I think i am going to have to give up on it.
Although this will give me completely random numbers:
static void RandomIntArray()
{
Random r = new Random();
int[] intArray = new int[10];
for (int i = 0; i < intArray.Length; i++)
intArray = r.Next(0, 1001);
foreach (int num in intArray)
Console.WriteLine(num.ToString());
Console.ReadLine();
}
Pedantic note about the finding prime numbers program: It looks like you'll get 0 as a prime number, which it isn't. All primes are 2 or above.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement