November 2002
Intermediate to advanced
560 pages
11h 16m
English
We conclude this appendix by working through a complete, though small, example of how the .NET Framework enables different languages to be combined to solve a problem.
Many programming courses cover the generation of prime numbers using an algorithm known as “the Sieve of Eratosthenes.” Primes are useful in many applications, including hashing algorithms and cryptography, so being able to generate them easily is useful on a practical level.
The method in Listing G.3[6] is an implementation of the Sieve of Eratosthenes in C#.
[6] We use the common idiom of using division to check for multiples. A “true” sieve uses index incrementing and involves no division, but the method ...
Read now
Unlock full access