1.

Write a PL/SQL program to find greatest of three numbers and print Fibonacci series up the largest number found.

Answer» #greatest number

a=int(input("Enter the first number"))

b=int(input('Enter the second number"))

c=int(input("Enter the third number"))

if (a>b and a>c):

    print(a,"is the greatest of three numbers")

    lim=a

elif (b>c):

    print(b,"is the greatest of three numbers")

    lim=b

else:

    print(c,"is the greatest of three numbers")

    lim=c

#to select the limit

z=0,x=1

print(z)

print(x)

for i in range(2,lim+1):

    z=x

    x=i

    print(z+x)


Discussion

No Comment Found

Related InterviewSolutions