We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3
5.
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load Dim s As String Dim i As Integer
s = InputBox("test", "taper un nombre entier")
i = CType(s, Integer) i = i * 2 MsgBox(i.ToString) MessageBox.Show(i.ToString) End Sub End Class
6. Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load Dim s As String Dim i As Integer
s = InputBox("test", "taper un nombre entier")
If IsNumeric(s) Then i = CType(s, Integer) i = i * 2 MsgBox(i.ToString) Else MsgBox("Erreur de saisie") End If End Sub End Class
7. Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load Dim i As Integer For i = 2 To 100 Step 2 label1.text = i.ToString Label1.Refresh() MsgBox(i) Next i End Sub End Class
9. Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load Dim i As Integer Dim sFin As String Dim fin As Integer sFin = InputBox("Donner un nombre entier") fin = CInt(sFin)
For i = fin To 1 Step -1
If i <> 4 Then Label1.Text = i.ToString Label1.Refresh() MsgBox(i) End If Next End Sub End Class
10. Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load Dim Counter As Integer = 0 While Counter * Counter < 1000 Label1.Text = Counter.ToString Counter += 1 End While End Sub End Class
12. Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load Dim rep As String Dim r As Integer Do rep = InputBox("tapez un chiffre entre 1 et 12") r = CType(rep, Integer) Loop Until r > 0 And r < 13 MsgBox(rep) End Sub End Class
13. Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load Dim i As Integer = 0 Dim somme As Integer Do i = i + 1 somme = somme + i