Multiplication Table Example

Simple example using different languages to accomplish the same thing.

(Note: Display (formatting) may vary depending on the language, but the results will be the same)

I am going to start by showing source code for multiple languages to create a multiplication table.  The point of this exercise, is to show the differences between various languages and how to do basic input/output, loops, variables, screen formatting.

This will be a Work In Progress, so I will be updating this post, to add additional languages and fix any minor glitches.

First we will look at C++ Just click the link below to navigate to that page to see the code.

Language C++ ; No runtime required

Language C++, .net v.4.0 runtime required.

Now we will look at C#. Since C# requires the .net runtime, there will be only one example.

Language C#, .net v.4.0 runtime required.

As you can see the C# and C++ CRL versions are extremely similar. This has to do with both using the .net library/class. The main difference you will see is how each language refers to its members. In C++ Two : are used where as in C# a single . is used. Also C# does not have to include any files, as it assumes you will be using the .net library/class.

Visual Basic also requires the .net runtime. However because of how the language was created, it does not require you to specify the runtime.

Visual Basic

The above languages require compiling. Whereas the following languages do not, so they are called scripting languages.

The first language JavaScript will be run in a web browser.

JavaScript (web browser)

This next language is Powershell a Scripting language for accessing the .net library in Microsoft Windows. I added this language as parts of it have become open sourced and is being ported to other operating systems. (Or that is the plan the last I heard)

Microsoft Powershell