# Bounded Iteration Example

Create an algorithm in flowchart AND pseudocode to accomplish the following task:

“output the squares of all numbers from 2 to 75 inclusive”.

## Flowchart Solution

The solution was also generated in Flowgorithm and is shown below:

## Pseudocode

The solution in PSEUDOCODE is shown below:

Start
For i = 2 to 75
Output i , ” Squared is ” , i * i
EndFor
End

# BONUS: Coded solutions!

## Pascal

The pascal code for the above algorithm is shown below:

Copy-able code:
program Squares;
uses
crt;
var
i:integer;
begin
for i:=2 to 75 do
writeln (i, ‘ squared is ‘ , i*i);
writeln();
writeln(‘Press any key to continue…’);
end.

## C# Solution

The following is a solution in C#:

See here for instructions on setting up Visual Studio to start using C#

Copy-able code:
using System;
namespace Squares
{
class Program
{
static void Main(string[] args)
{
for (int i = 1; i <= 75; i++)
Console.WriteLine(i + ” squared is ” + (i * i));
//pause execution here
Console.WriteLine(“press any key to continue….”);