Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void printnum(int num, q , n);
  4.  
  5. int main(void)
  6. {
  7. int num = 0
  8. int q = 0;
  9. int n = 0;
  10. printf("enter the first element: \n");
  11. scanf("%d" , &num);
  12. printf("enter the series ratio: \n");
  13. scanf("%d" , &q);
  14. printf("enter number of the elements to display: \n");
  15. scanf("%d" , &n);
  16.  
  17.  
  18.  
  19. }
  20.  
  21.  
  22. /*
  23. function that prints a number
  24. */
  25.  
  26. void printnum(int num, q , n)
  27. {
  28. for(int i = 0; i<=n)
  29. {
  30. int result = num*pow(q,n);
  31. printf("%d" , result);
  32.  
  33. }
  34.  
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement