In a row of five squares, each square is to be colored either red, yellow, or blue, so that no two consecutive squares have the same color. How many ways are there to color the five squares?

For the first square, there are three choices: red, yellow, or blue.

For the second square, there are also three choices: whatever color we didn't use for the first square.

For the third square, there are two choices: any color except the one used for the second square.

For the fourth square, there are two choices: any color except the one used for the third square.

For the fifth square, there are two choices: any color except the one used for the fourth square.

Since each choice for coloring a square is independent of the previous choices, there are a total of $3\cdot 3\cdot 2\cdot 2\cdot 2=\boxed{72}$ ways to color the five squares.

To solve this problem, we will use a step-by-step approach.

Step 1: Determine the options for the first square.
Since there are three colors available (red, yellow, and blue) for the first square, we have three options to choose from.

Step 2: Determine the options for the second square.
Since we cannot have two consecutive squares with the same color, we have two options left for the second square (any color except the one used for the first square).

Step 3: Determine the options for the third square.
Again, we have two options left for the third square (any color except the one used for the second square).

Step 4: Determine the options for the fourth square.
Similar to step 3, we have two options left for the fourth square (any color except the one used for the third square).

Step 5: Determine the options for the fifth square.
For the final square, we again have two options left (any color except the one used for the fourth square).

Step 6: Multiply the options from each step.
To calculate the total number of ways to color the five squares, we multiply the options from each step together:
3 options (step 1) x 2 options (step 2) x 2 options (step 3) x 2 options (step 4) x 2 options (step 5) = 48

Therefore, there are 48 ways to color the five squares without having any two consecutive squares with the same color.

To solve this problem, we can use the counting principle, also known as the multiplication principle.

Step 1: Let's choose a color for the first square. We have three options: red, yellow, or blue.

Step 2: Once we have chosen a color for the first square, we move on to the second square. We need to choose a color for the second square in such a way that it is different from the color of the first square. We have two options left, as one color has already been used.

Step 3: For the third square, we again need to choose a color that is different from both the first and second squares. We have two options left.

Step 4: For the fourth square, we follow the same pattern. We have two options left.

Step 5: Finally, for the fifth square, we have only one option, as we must choose a color different from the fourth square.

By multiplying the number of options at each step, we get the total number of ways to color the five squares:

3 * 2 * 2 * 2 * 1 = 12

Therefore, there are 12 different ways to color the five squares, such that no two consecutive squares have the same color.