menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Count the ...
source image

Prodevelopertutorial

2d

read

296

img
dot

Count the number of ways a baby can reach the n’th stair taking 1 or 2 steps at a time in C language.

  • A baby wants to climb the stairs taking 1 or 2 steps at a time.
  • The number of ways to reach the top of the stairs is equal to Fibonacci(N + 1).
  • The solution in C language involves calculating the Fibonacci series.
  • The program takes the number of stairs as input and outputs the number of ways the baby can climb.

Read Full Article

like

17 Likes

For uninterrupted reading, download the app