Hari Prasad Misra Of IT Branch has to climb up stairs daily to reach to his class room. But(adsbygoogle = window.adsbygoogle || []).push({});

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

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# How it will be solved

**Physics Forums | Science Articles, Homework Help, Discussion**