Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How it will be solved

  1. Sep 18, 2008 #1
    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
    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:
    Sample Output
  2. jcsd
  3. Sep 18, 2008 #2


    User Avatar
    Science Advisor

    No, believe it or not, I do not have to write a program for him! Perhaps you do and, if you get started on it, someone here might make suggestions how to improve your program.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook