Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

can't understand the output of the program

$
0
0
Quote:

Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles Button1.Click
Dim no1 As Single = 4
Dim no2 As Double = 18
Dim result As Double
Dim flag1 As Boolean = False
TextBox1.Text = ""
Do
If no1 < no2 Then
result = Int(no2 / no1)
ElseIf no1 = no2 Then
result = no1
TextBox1.Text = TextBox1.Text & vbCrLf
Else
result = Int(no1 / no2)
flag1 = True
End If

no1 = no1 + 0.25
no2 = no2 / 2
TextBox1.Text = TextBox1.Text & result & "+++"


Loop Until flag1
TextBox1.Text = TextBox1.Text & vbCrLf & flag1


End Sub

The output is :
Quote:

4+++2+++
4,5+++2+++
True

what is the logic behind this program

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>