4 Comments


  1. How to check prime numbers in the range of 100 using 2d array which fill random if user enter 5 then program will make matrix 5×5 and fill random numbers range of random numbers are 10 t0 100 and how we find prime numbers in the filling matrix

    Reply

  2. you don’t have to check numbers up to n/2. Square root of ‘n’ would be enough.
    (…)
    for (int i = 2; i <= sqrt(n); i++)
    (…)

    Reply

  3. i <= 9?

    Reply

Leave a Reply.. code can be added in <code> </code> tags