Computer Science, asked by srijaellini25, 2 months ago

An e-commerce website wishes to find the lucky customer who will be

eligible for full value cash back. For this purpose, a number N is fed to the system. It will return another number that is calculated by an algorithm. In the algorithm, a sequence is generated, in which each number is the sum of the two preceding numbers. Initially the sequence will have two 1's in it. The system will return the Nth number from the generated sequence which is treated as the order
ID. The lucky customer will be the one who has placed that order.
Write an algorithm to help the website find the lucky customer.
Sample Testcases
Testcase 1 Input
8
Testcase 1 output
21​

Answers

Answered by varshinihg1
0

Explanation:

the sequence generated by the system will be 1,1,2,3,5,8,3,21. the 8th number in the sequence is 21.the lucky customer is the one who has placed the order with order ID 21

Similar questions