Problem with while function

Problem with while function - Poruke

#1 Objavljeno: 16. 2. 2009. 23:24:49
dominator86

dominator86

0 svidjanja u 5 postova.

Grupa: User

I'm not sure but I think it's a bug. I tried to use the while function and when I want to converge a number to a constant there is no problem. But when I want to converge two numbers to each other like below, the program stops working.

Example:

x:=0
a:=20-2*x
b:=15-x
while a>b x:=x+1
#2 Objavljeno: 16. 2. 2009. 23:54:23
Andrey Ivashov

Andrey Ivashov

2.345 svidjanja u 4.060 postova.

Grupa: Super Administrator

This is not a bug.
Second line (a:=20-2*x) program calculate as a:=20, becouse you've define x:=0; third line has similar result, so your condition in while loop is allways true.

Here is solution:

(download an example)
  • Novi postovi
  • Nema novih postova