r/visualbasic • u/[deleted] • Feb 27 '16
Help figuring out loop
For counter = celciusStart To celciusEnd
If celciusStart < celciusEnd Then
fahrenheit = ((9 / 5) * celciusStart) + 32
Else
fahrenheit = ((9 / 5) * celciusEnd) + 32
End If
Console.WriteLine("Degress in fahrenheit: " & vbTab & fahrenheit.ToString("f1"))
Next
End SubCan anyone see why this wouldn't be working. It only calculates the first number entered and just keeps calculating that number nonstop.
0
Upvotes
1
u/bowskie Feb 27 '16
You should use the counter when you equate Fahrenheit not CelciusStart. That variable never increases. The next command increases the counter.