Page 450 - CITS - CSA - TP (Volume 1) - Hindi
P. 450
कंप्यूटर सॉफ्टवेयर एप्लीकेशन- CITS
ॉपट बॉ (Property Box):
म सं. क ोल ॉपट मान
1 कमांड बटन 1 नाम cmdsolution
कै शन Solution
2 कमांड बटन 2 नाम cmdclear
कै शन Clear
ेप (Step)3 : यर बटन पर डबल क कर और िन कोड िलख :
Private Sub cmdclear_Click()
Range(“B2:B9,A6:A8”) = “ “
End Sub
Step 4: Double click on the Solution button and write down the following code:
Private Sub cmdsolution_Click()
Dim a As Integer, b As Integer, c As Integer
Dim d As Single, root1 As Single, root2 As Single
a = InputBox(“Enter the value of a”)
b = InputBox(“Enter the value of b”)
c = InputBox(“Enter the value of c”)
Range(“B2”) = a
Range(“B3”) = b
Range(“B4”) = c
d = b * b - 4 * a * c
Range(“A6”) = “Discriminent”
Range(“B6”) = Round(d, 2)
If d = 0 Then
root1 = -b / (2 * a)
Range(“A7”) = “Root is “
Range(“B7”) = Round(root1, 2)
Range(“B9”) = “ Roots are real and Equal”
ElseIf d > 0 Then
root1 = (-b + Sqr(d)) / (2 * a)
root2 = (-b - Sqr(d)) / (2 * a)
Range(“A7”) = “Root1 is “
Range(“B7”) = Round(root1, 2)
Range(“A8”) = “Root2 is “
Range(“B8”) = Round(root2, 2)
Range(“B9”) = “ Roots are real and UnEqual”
Else
Range(“B9”) = “ Roots are imaginary”
434
CITS : IT & ITES - कं ूटर सॉ वेयर ए ीके शन - अ ास 70

