Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net C# simple for Next loop

Hi

Is there a more simple way to do the following For Next Loop in C#

public void A()
{
      int i = 0;
      for (i = 1; i <= 10; i++) {
            Interaction.MsgBox(Convert.ToString(i));
      }
}

I got this from converting the following VB.net code which looks far more simple

    Sub A()
        Dim i As Integer
        For i = 1 To 10
            MsgBox(CStr(i))
        Next i
    End Sub
ASKER CERTIFIED SOLUTION
Avatar of Member_2_99151
Member_2_99151

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Thanks very much