Advertisement
apl-mhd

RECURSIONsERIESE

Dec 20th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void series(int start, int end,int count){
  5.     if(count == 0)
  6.         printf("%d ", start);
  7.  
  8.     if(count == end -1 )
  9.         return;
  10.     else{
  11.  
  12.  
  13.         printf("%d ",start +=3);
  14.     }
  15.  
  16.     series(start, end, count+1);
  17. }
  18.  
  19. int main()
  20. {
  21.  
  22.     int start, term,count=0;
  23.  
  24.     scanf("%d%d",&start,&term);
  25.     //printf("%d ", start);
  26.     series(start, term,count);
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement