MsgBox "Bonjour !", vbOKCancel, "LP-GC-2021/2022" End Sub
Public Sub exemple03()
x = InputBox("Entrer une valeur entiere", "LP GC") MsgBox x End Sub
Public Sub Parite()
x = InputBox("Entrer une valeur entiere", "Parite") If x Mod 2 = 0 Then MsgBox x & " est un nombre paire", vbOKOnly, "Parite" Else MsgBox x & " est un nombre impaire", vbOKOnly, "Parite" End If End Sub
Public Sub Max()
x = InputBox("Entrer une premiere valeur entiere", "Maximum") y = InputBox("Entrer une deuxieme valeur entiere", "Maximum") If x > y Then MsgBox x & " est plus grand que " & y, vbOKOnly, "Maximum" Else MsgBox y & " est plus grand que " & x, vbOKOnly, "Maximum" End If End Sub
Public Sub absolue()
x = InputBox("Entrer une valeur ", "Maximum") If x >= 0 Then absol = x Else absol = -x End If MsgBox "|" & x & "| = " & absol End Sub