Advertisement
sujonshekh

Q1. Need edit

Sep 2nd, 2016
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. Q1. Needs Edit
  2. coz output show like this 4+16+64+256+1024+4096+
  3. solve it
  4. & up here :D
  5.  
  6. #include<stdio.h>
  7.  
  8. recursion(int num)
  9. {
  10.     if(num > 100000)
  11.     {
  12.         return;
  13.     }
  14.     printf("%d+",num);
  15.     recursion(num * 4);
  16. }
  17.  
  18. int main()
  19. {
  20.     int n;
  21.     scanf("%d",&n);
  22.     recursion(n);
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement