Advertisement
Guest User

Untitled

a guest
May 28th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int find_ways(int n){
  4. if(n == 0) return 1;
  5. if(n==1 || n==2 || n ==3 )
  6. return 1;
  7. return find_ways(n-1) + find_ways(n-4);
  8. }
  9.  
  10. int main(void) {
  11. int N =5;
  12. printf("%d", find_ways(N));
  13. // your code goes here
  14. return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement