elancholan / Climbing-stairs-

0 stars 0 forks source link

Climbing stairs #1

Open elancholan opened 1 month ago

elancholan commented 1 month ago

include

int climbstairs(int n) { if(n<=1) { return 1; } return climbstairs(n-1)+climbstairs(n-2); } int main() { int n; printf("enter the number:"); scanf("%d",&n); int ways=climbstairs(n); printf("number of ways to climb %d stairs=%d\n",n,ways); return 0; }

elancholan commented 1 month ago

Screenshot_20241004_200210 Screenshot_20241004_200153