Am I Ready?

Started by
42 comments, last by melloorr 12 years, 8 months ago
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.
Advertisement
The 'continue' in your for loop serves no purpose
I cant do it :(
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.

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.


Thank you, it did not say 0 was a prime number, but i did say 1 was :)

This topic is closed to new replies.

Advertisement