Home > Software engineering >  VB2010 learning edition
VB2010 learning edition

Time:11-09

Which VB great god help me have a look at this problem, I don't know where I went wrong) just enter a larger number will go wrong

CodePudding user response:

Help me to check it out (?????? Man?? )

CodePudding user response:

Write well, you see right:
 
Public Class Form1
The Function GetSum (ByVal n As Long)
Dim dblA As Double=2
Dim dblB As Double=1
Dim dblSum As Double=0
For As Long I=1 To n
DblSum +=dblA/dblB
DblA=dblA + dblB
DblB=dblA - dblB
Next
Return dblSum
End the Function

Private Sub Button1_Click (sender As Object, As EventArgs e) Handles for. Click
MsgBox (GetSum (TextBox1. Text))
End Sub
The End of the Class

Download address:
Link: https://pan.baidu.com/s/1DhdtKJFGG3C6pSnOufpuDQ
The extracted code: tec0

Run the example:

CodePudding user response:

That is to say as long as I put before the Fa and Fb is defined as Double is ok, is this meaning?

CodePudding user response:

You try to know;
  • Related