-
-
Save Pharap/ee2bd909e5994df58c956862ed7a3095 to your computer and use it in GitHub Desktop.
Printing 10 numbers in 9 different languages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Ada | |
with Ada.Text_IO; | |
use Ada.Text_IO; | |
procedure Example is | |
begin | |
for i in 0..9 loop | |
Put("i = "); | |
Put_Line(i); | |
end loop; | |
end Example; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 REM BASIC | |
20 | |
30 FOR I = 0 TO 9 | |
40 PRINT "I = "; I | |
50 END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// C++ | |
#include <iostream> | |
int main(int argument_count, char * arguments[]) | |
{ | |
for(int i = 0; i < 10; ++i) | |
std::cout << "i = " << i << '\n'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// C# | |
using System; | |
class Example | |
{ | |
public static void Main(string[] arguments) | |
{ | |
for(int i = 0; i < 10; ++i) | |
Console.WriteLine("i = {0}", i); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Java | |
class Example | |
{ | |
public static void main(String[] arguments) | |
{ | |
for(int i = 0; i < 10; ++i) | |
System.out.println("i = " + i); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Lua | |
for i = 0, 9 do | |
print("i = "..i) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ Pascal } | |
program example; | |
var | |
i: integer; | |
begin | |
for i := 0 to 9 do | |
begin | |
writeln('i = ', a) | |
end; | |
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' QB64 (QBasic) | |
For i = 0 To 9 | |
PRINT "i = "; i | |
Next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Visual Basic | |
Module Example | |
Sub Main() | |
For i As Integer = 0 To 9 | |
Console.WriteLine("i = {0}", i) | |
Next | |
End Sub | |
End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment