(i)
Design a calculator using Controls array of controls
Dim num1
Dim op As String
Private Sub cmddigit_Click(Index As Integer)
Text1.Text = Text1.Text &cmddigit
(Index).Caption
End Sub
Private Sub cmdequal_Click()
Select Case op
Case "+"
Text1.Text = Text1.Text + num1
Case "-"
Text1.Text = Text1.Text - num1
Case "*"
Text1.Text = Text1.Text * num1
Case "/"
Text1.Text = Text1.Text / num1
End Select
End Sub
Private Sub cmdop_Click(Index As Integer)
num1 = Val(Text1.Text)
Text1.Text = ""
op = cmdop(Index).Caption
End Sub
OUTPUT:
program in c++, inline function, function, c plus plus, c plus plus programs, c++
Post a Comment