Programming Puzzles

For My Students

In my experience, computer programming students generally fall into one of three categories:

  1. I LOVE PROGRAMMING: They immediately become hooked on programming in any language! They are excited, enthusiastic and they gain immense satisfaction from solving programming problems. These puzzles should be a welcome choice to improve programming skills.
  2. I CAN TAKE IT OR LEAVE IT: These students do well in programming classes because they are bright and can assimilate the concepts and apply them, but they find little joy in programming. Hopefully, these challenges will be more interesting and fun that the text examples.
  3. I CAN’T STAND THIS: These students quickly become lost and confused. A simple problem such as ‘Write a program that when given the radius of a circle, will return the area of that circle.’ offers them no clue how to begin or what steps are required. Although more difficult for these students, a willingness to work at these problems will almost certainly help them to understand programming concepts.

The Puzzles

WARNING! Links in this table are only active when the problem is being made available to my students, so many links will be inactive!

01 Find the sum of integers below 1,000 that are multiples of 3 or 5.


Here are the rules for puzzle submissions:

  1. The following two items must be forwarded as attachments to me at
    • A text file containing complete, working source code that solved the given problem. In the first three lines, comments must include the
      Students Name, Class Number, Problem Number and a brief description of the problem
      . The source code will be in text format and have the extension .C or .PY or
      the appropriate extension for the language the code is written in
    • A screen shot of the program execution that contains the correct answer in .JPG format .
  2. The date/time stamped on the email shall be the time of submission. The first correct entry received will be awarded four points, the second correct entry two points, and all other entries one point.
  3. Cumulative points at the end of each quarter will determine the standings of all applicants. Prizes, usually certificates suitable for inclusion in your employment portfolio, will be awarded to n students, where n is the square root of the total number of applicants.
  4. Using the Internet or other sources to research the problem for ideas and possible solutions is acceptable, but any student found to have copied source code from any source shall be disqualified from all future submissions.
  5. A statement that the source code submitted is the sole product of the student and not copied from other sources will be in a comment at the end of the source code.

Online Sources

Sites with Programming Puzzles:

Project EulerThe BEST source of programming puzzles on the Net.
Python ChallengeAlthough specializing in Python, these problems can be solved in any language.
Top CoderHundreds of problems from past competitions.
gowrikumar.comProblems showcasing the unique complexities of the C programming language.
Six RevisionsTen sites where puzzles can be found.