This is the easiest way for me. Simply plug in your values into the parameters. I started with 1 and 1 like your example.
DELCARE @Y INT
DECLARE @Z INT
DECLARE @FIB INT
SET @Y = 1
SET @Z = 1
SET @FIB = 0
PRINT @Y
PRINT @Z
WHILE @FIB < 2000
BEGIN
SET @FIB = @Y + @Z
PRINT @FIB
SET @Y = @Z
SET @Z = @FIB
END
↧