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

Asked

Viewed 138 times

-3

How can I make a loop of a line using VB.NET? In other languages I can do it without any problem as in the examples below:

I have set as an example only for the for but in all languages as much while how much do while would also serve

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

Java testing

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

Test in C#

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

Javascript testing

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

Test 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 listed, and the results are just below them. They’re not as wrong as he says.

  • 1

    All loops go from 0 to 9 and you describe results from 1 to 9.

1 answer

2


  • I have science in this way but the question is to write in one line and not in 3. In addition the examples I put of other languages are only to demonstrate the focus of the question and are not right

  • 3

    If you show something wrong, you can’t complain about getting the wrong answer.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.