- #1
s_chaursia
- 3
- 0
Hari Prasad Misra Of IT Branch has to climb up stairs daily to reach to his class room. But
daily he doesn’t manage to reach in the class room on time.
So, he decided to form a program which tells him in how many ways he can climb upstairs
and reach to his class room.
But he can climb Maximum of 2 Stairs at one time.
You need to write a program for him in order to calculate the NO. of possible ways to reach
when he can climb one step, two steps, or one or two steps both simultaneously to reach up
stairs.
Example:
Here No of stairs are =3
So the possible ways are 3 stairs
First way 1,1,1(steps)
Second way 1,2(steps)
Third Way 2,1(steps)
So the no of ways are= 3
INPUT You have to take No. of staircases as an input. Where No. (0<=N<=100).
OUTPUT You have to print the No. of Possible ways.
Sample Input:
6
4
3
Sample Output
13
5
3
daily he doesn’t manage to reach in the class room on time.
So, he decided to form a program which tells him in how many ways he can climb upstairs
and reach to his class room.
But he can climb Maximum of 2 Stairs at one time.
You need to write a program for him in order to calculate the NO. of possible ways to reach
when he can climb one step, two steps, or one or two steps both simultaneously to reach up
stairs.
Example:
Here No of stairs are =3
So the possible ways are 3 stairs
First way 1,1,1(steps)
Second way 1,2(steps)
Third Way 2,1(steps)
So the no of ways are= 3
INPUT You have to take No. of staircases as an input. Where No. (0<=N<=100).
OUTPUT You have to print the No. of Possible ways.
Sample Input:
6
4
3
Sample Output
13
5
3