Default-image

Simple Problems

1. Create an algorithm that prints the multiplication tables up to 10 for any given number.

2. Create an algorithm that adds all natural numbers before and including the input number for example if the input is 3 then add 1 + 2 + 3 and output 6.

3. Create an algorithm that adds the squares of Natural numbers. For example if you input 3 you add 1 + 4 + 9 and output 14.

4. Swap two numbers: Example if you input 7, 6 then output 6, 7

5. Dice problem: You roll a dice and input the number on the top face, the program needs to print out the number on the bottom face of the dice.

Easy Problems

1. Check if the input number is a prime number, A prime number is a number greater than 1 that has no positive divisors other than one and itself.

2. Calculate the distance between two points on a graph.

3. Find the least common multiple of two numbers.

Medium Problems

  1. Find the largest prime factor of a number, remember from above what a prime number is and find the largest one that you can divide the input number by with no remainder.

Hard Problem

  1. Solve the Towers of Hanio problem, which is the steps necessary to move a stack of disks from one tower to another without setting a larger disk on a smaller one. Big bonus points if you can figure this one out without cheating and looking up the answer online.

Leave a Reply

Share via
Copy link
Powered by Social Snap