Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. //----------sequence
  5.  
  6. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  7.  
  8. int main(int argc, char *argv[])
  9. {
  10.     int i,n,s,m;
  11.     printf("sequense n?");
  12.     scanf("%d", &n);
  13.     for(i=0;i<n;i++)
  14.         {
  15.             m=s+m;
  16.             s=m-s; 
  17.             printf("%d\n", s);
  18.         }
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement