Operatii Aritmetice – Visual Basic 2008

A + B = adunare
A – B = scadere
A * B = inmultire
A / B = impartire

Dim adunare As Double = 5 + 5
MsgBox(adunare)

Exemplu:

Dim A As Double = Textbox1.Text
Dim B As Double = Textbox2.Text
MsgBox(A + B)
MsgBox(A - B)
MsgBox(A * B)
MsgBox(A / B)

A si B sunt variabilele declarate, si in functie de numerele introduse, se vor efectua operatiile de adunare, scadere, inmultire si impartire.

Sursa

2 Comments

Adaugă un răspuns

Your email address will not be published. Required fields are marked *