Hi
Basically I am print out a group of number with a certain increment. However I found out a wierd thing happened from the result
The code I wrote:
Dim number1, number2, counter, increment As Double
Console.Write(" Enter number1:")
number1 = Console.ReadLin e
Console.Write(" Enter number2:")
number2= Console.ReadLin e
Console.Write(" Enter increment: ")
increment = Console.ReadLin e For count = lower_flow_rate To upper_flow_rate Step increment
count = count + increment
Console.WriteLi ne("{0:F}", count)
next
I was trying to print out a group of number from 0.8-1.5 with the increment of 0.05. However when the result came out it's 0.85,0.95, 1.05, 1.15,1.25, 135.1.45. and the increment is not 0.05 but 0.1.
But when i try any number that is great than 1, it works. Fox example number from 1.0-1.5, all the numbers that are printed out are with the 0.05 increment.
I got really confused here.
can anyone plz help me with this
Really appreciate!!!
Basically I am print out a group of number with a certain increment. However I found out a wierd thing happened from the result
The code I wrote:
Dim number1, number2, counter, increment As Double
Console.Write(" Enter number1:")
number1 = Console.ReadLin e
Console.Write(" Enter number2:")
number2= Console.ReadLin e
Console.Write(" Enter increment: ")
increment = Console.ReadLin e For count = lower_flow_rate To upper_flow_rate Step increment
count = count + increment
Console.WriteLi ne("{0:F}", count)
next
I was trying to print out a group of number from 0.8-1.5 with the increment of 0.05. However when the result came out it's 0.85,0.95, 1.05, 1.15,1.25, 135.1.45. and the increment is not 0.05 but 0.1.
But when i try any number that is great than 1, it works. Fox example number from 1.0-1.5, all the numbers that are printed out are with the 0.05 increment.
I got really confused here.
can anyone plz help me with this
Really appreciate!!!
Comment