25-10-16, 02:33 PM
(25-10-16, 02:12 PM)ممدوح كتب : هذه مشاركة
كود :
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim n1 As Integer = InputBox("أدخل الرقم الأول")
Dim n2 As Integer = InputBox("أدخل الرقم الثاني")
Dim n3 As Integer = InputBox("أدخل الرقم الثالث")
Dim result As String = ""
result &= "the square of " & n1 & " = " & Math.Pow(n1, 2) & vbNewLine
result &= "and the cube of " & n1 & " = " & Math.Pow(n1, 3) & vbNewLine
result &= "the square of " & n2 & " = " & Math.Pow(n2, 2) & vbNewLine
result &= "and the cube of " & n2 & " = " & Math.Pow(n2, 3) & vbNewLine
result &= "the square of " & n3 & " = " & Math.Pow(n3, 2) & vbNewLine
result &= "and the cube of " & n3 & " = " & Math.Pow(n3, 3) & vbNewLine
Label1.Text = result
End Sub
استخدام Math.Pow يعادل العلامة ^
كلها نفس النتيجة
طريقة الحل تختلف تماما عن مواضيع دراستنا انا مبتدئية لسى نكتب ابسط الاكواد
