Computing Prime Numbers

From CompSciWiki
Revision as of 11:41, 6 April 2010 by ChristopherJ (Talk | contribs)

Jump to: navigation, search

Back to the Program-A-Day homepage

Problem

It is often useful to compute prime numbers (e.g. Encryption). Compute prime numbers up to 20 by use of nested loops.

 

SideSectionTitle

float
Taken from http://www.flickr.com/photos/daniello/565304023/

An image or By Students section

Solution

You start by using a for loop that will count from 1 to 20.

Code

SolutionCode goes here. Please DO NOT put your code in <pre> tags!

Back to the Program-A-Day homepage