Skip to content

Instantly share code, notes, and snippets.

@tdantas
Created November 13, 2012 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdantas/4067114 to your computer and use it in GitHub Desktop.
Save tdantas/4067114 to your computer and use it in GitHub Desktop.
Programming Trick
Objective:
Write a program that prints out a multiplication table of the first 10 prime numbers.
The program must run from the command line and print to screen 1 table.
Across the top and down the left side should be the 10 primes, and the body of the table should
contain the product of multiplying these numbers.
Please include Rspec tests.
P.s. the prime numbers should be calculated, rather than using Ruby’s Prime Method
## OUTPUT ##
x 2 3 5 7 11 13 ...
2 4 6 10 14 22 26
3
5
7
11
13
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment