Jump to content

[VB.Net] Expresia "For" si "While"


Tudoski
 Share

Recommended Posts

Salut! Acesta este primul meu tutorial, deci sa incepem.

Expresia "For" e foarte cunoscuta, si gasita cam in orice limbaj de programare.

VB.Net :

 

For i as integer to x step 2 'Unde i = variabile pe care o inregistram ca intreg, x = pana la cat vom folosi variabila, step e optional, dar uneori e folositor.
Console.WriteLine(i)
Next i

 

 

Acum sa trecem la Expresia "While".

 

Aceasta expresie nu e la fel de cunoscuta.

 

Exemplu de folosire a expresiei "While" in VB.Net

 

While i = x  'Atentie! Spre deosebire de for, expresi "While" nu adauga 1 sau cat ai setat la step variabilei folosite, while lasa variabila asa cum ai bagat-o.
Console.WriteLine("Este egalitate!")
End While

 

 

Sper sa ne mai auzim! O zi buna B-Zone!

Tutorial by uNknow123

Edited by Cdorsu
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.