VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This program will take any 2 numbers and add, subtract, multiply and divide them together. Plus it

by Spenser Newton (7 Submissions)
Category: Math/Dates
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 12th March 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This program will take any 2 numbers and add, subtract, multiply and divide them together. Plus it will individualy square, cube, find the

Rate This program will take any 2 numbers and add, subtract, multiply and divide them together. Plus it



Dim n1 As Single, n2 As Single
n1 = Val(txtn1)
n2 = Val(txtn2)
lbladd = n1 + n2
lblsub = n1 - n2
lblmulti = n1 * n2
lbldivide = n1 / n2
lbls1 = n1 ^ 2
lbls2 = n2 ^ 2
lblr1 = Sqr(n1)
lblr2 = Sqr(n2)
lblpie1 = n1 * 3.14
lblpie2 = n2 * 3.14
lbl31 = n1 ^ 3
lbl32 = n2 ^ 3
lblt1 = Tan(n1)
lblt2 = Tan(n2)
lblc1 = Cos(n1)
lblc2 = Cos(n2)
lblsi1 = Sin(n1)
lblsi2 = Sin(n2)
Printer.Print "Spenser Newton, calculator"
Printer.Print "The integers entered were "; ; txtn1, txtn2
Printer.Print "The sum of the integers was "; lbladd
Printer.Print "The difference of the integers was "; lblsub
Printer.Print "The product of the integers was "; lblmulti
Printer.Print "The quotient of the integers was "; lbldivide
Printer.Print "The first integer squared was "; lbls1
Printer.Print "The second integer squared was "; lbls2
Printer.Print "The square root of the first integer was "; lblr1
Printer.Print "The square root of the second integer was "; lblr2
Printer.Print "The first integer times pie was "; lblpie1
Printer.Print "The second integer times pie was "; lblpie2
Printer.Print "The first integer cubed was "; lbl31
Printer.Print "The second integer cubed was "; lbl32
Printer.Print "The Tangent of the first integer was "; lblt1
Printer.Print "The Tangent of the second integer was "; lblt2
Printer.Print "The Cosine of the first integer was "; lblc1
Printer.Print "The Cosine of the second integer was "; lblc2
Printer.Print "The Sine of the first integer was "; lblsi1
Printer.Print "The Sine of the second integer was "; lblsi2
Printer.Print ""
End Sub

Private Sub cmdClear_Click()
txtn1 = " "
txtn2 = " "
lbladd.Caption = " "
lblsub.Caption = " "
lblmulti.Caption = " "
lbldivide.Caption = " "
lbls1.Caption = " "
lbls2.Caption = " "
lblr1.Caption = " "
lblr2.Caption = " "
lblpie1.Caption = " "
lblpie2.Caption = " "
lbl31.Caption = " "
lbl32.Caption = " "
lblt1.Caption = " "
lblt2.Caption = " "
lblc1.Caption = " "
lblc2.Caption = " "
lblsi1.Caption = " "
lblsi2.Caption = " "
End Sub

Private Sub cmdEnd_Click()
End
End Sub

Download this snippet    Add to My Saved Code

This program will take any 2 numbers and add, subtract, multiply and divide them together. Plus it Comments

No comments have been posted about This program will take any 2 numbers and add, subtract, multiply and divide them together. Plus it . Why not be the first to post a comment about This program will take any 2 numbers and add, subtract, multiply and divide them together. Plus it .

Post your comment

Subject:
Message:
0/1000 characters