Task
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:

Similar solution generated in Flowgorithm
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:

Solution in bloodshed Dev Pascal
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…’);
readkey();
end.
C# Solution
The following is a solution in C#:

Solution created using Visual Studio Community Edition
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….”);
Console.ReadKey();
}
}
}
© 2018 Vedesh Kungebeharry. All rights reserved