Aniket762/Project-alpha

Ways to Cover a Distance in C

Closed this issue · 3 comments

Given a distance ‘dist, count total number of ways to cover the distance with 1, 2 and 3 steps.

please explain this issue, I want to work on it. thanks

Given a distance you have to write a program in c to count total number of ways to cover the distance with 1, 2 and 3 steps.
For example:
Input: n = 3
Output: 4
Explantion:
Below are the four ways

  1. 1 step + 1 step + 1 step
  2. 1 step + 2 step
  3. 2 step + 1 step
  4. 3 step

please assign this to me.thanks