##PYTHON PROGRAM TO FIND FIBONACCI SERIES USING RECURRSION
global sum;
sum=0
first=0;
second=1;
print(first);
print(second);
def fab(first,second):
global sum
if(sum>100):
exit();
sum=first+second;
print(sum);
fab(second,sum);
fab(first,second);
global sum;
sum=0
first=0;
second=1;
print(first);
print(second);
def fab(first,second):
global sum
if(sum>100):
exit();
sum=first+second;
print(sum);
fab(second,sum);
fab(first,second);
No comments:
Post a Comment