How to loop ("FOR" or "WHILE" or "DO WHILE") in a row in VB.NET

-2

Hello, how can I loop a line using VB.NET? In other languages I can do it with no problem like the examples below:

  

I just put for as an example, but in both while and while

// Java
for(int i=0; i<10; i++) System.out.print(i + ", ");
// -> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,

Java Test

// CSharp
for(int i=0; i<10; i++) Console.Write(i + ", ");
// -> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,

CSharp Test

// Javascript
for(var i=0; i<10; i++) console.log(i + ", ");
// -> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,

Javascript Test

// PHP
for ($i = 0; $i < 10; $i++) echo $i.", ";
// -> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,

Testing in PHP

// VB.net
???
// -> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,

Edit

As @Maniero said, I was forced to take the test in all the languages I have listed, and the results are just below them. You are not wrong as he says.

    
asked by anonymous 25.01.2018 / 14:25

1 answer

1

You can write in several ways, one of them would be:

For i As Integer = 0 To 9 : Console.WriteLine(i & ", ") : Next

The result of the other languages is wrong.

    
25.01.2018 / 14:38