hi I am talking C# this semester, can anybody help me with my assignment?

Here is the problem:

Determines whether a number is prime by checking whether 2,3,4,5,6..., n/2 is a divisor. If a divisor is found, not is not a prime number. A more efficient approach to determine whether any of the prime numbers less than or equal to squareroot of n can divide n evenly. If not n is a prime number. To display the first fifty prime numbers using this, approach you need to use an array tp store prime numbers and later use them to check whether they are possible divisor of n.

I can't really understand the problem. That makes if difficult.. could anybody help me? or can anybody simplify the problem? thanks

Recommended Answers

All 4 Replies

Welcome to C#! As far as I can tell so far, you need help understanding what your assignment is, and you are not ready to begin coding it in C# until you do understand that. I think you should contact professor or classmate to get a better understanding of the actual assignment first, begin coding what you can in C#, then begin asking C# questions if you need too.

commented: Nice response! +8
commented: chic +7

Welcome to C#! As far as I can tell so far, you need help understanding what your assignment is, and you are not ready to begin coding it in C# until you do understand that. I think you should contact professor or classmate to get a better understanding of the actual assignment first, begin coding what you can in C#, then begin asking C# questions if you need too.

hi.. thanks... can you understand the problem?.. If you could, can you please explain it to me? Thanks. the thing is, our prof don't want to tell what we should really do. Ouch. :(

hi.. thanks... can you understand the problem?.. If you could, can you please explain it to me? Thanks. the thing is, our prof don't want to tell what we should really do. Ouch. :(

What is not clear from your original quote is what the actual requirements of the assignment are. It seams like you original problem statement has both ideas and the problem mixed in and rather than ask a bunch of questions to find out what it is exactly you need to do, you should state that, then you could ask questions about ideas you have and for specific suggestions, etc.:)

Here is a decent link to Fun with Prime Numbers. I went ahead and converted the "The Array Method (Sieve of Eratosthenes)" code section to C# just for fun and to make sure it worked. Anyway, the article explains different approaches to finding primes--give it a shot then check back for help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.