Untitled

mail@pastecode.io avatar
unknown
plain_text
14 days ago
229 B
0
Indexable
Never
n=int(input("enter a no"))
c=0
a=0
b=1

if n==0 or n==1:
    print("yes it is a fibonacci no")

else:
    while c<n:
        c=a+b
        b=a
        a=c

if c==n:
    print("yes")
else:
    print ("No")
    
Leave a Comment