Fibonacci series program in swift basic program for beginners

Fibonacci series program in swift basic program for beginners.This program will print the Fibonacci number in swift program. Program like fibonacci series is the basic set of program for beginners who is learning swift programming language.

var x = -1,
y = 1,
sum = 0;
for i in 0..<20
{
sum = x+y;
x   = y;
y   = sum;
print(sum);
}

Output:

0

1                                                                                                                              

1                                                                                                                              

2