Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void printnum(int num, q , n);
- int main(void)
- {
- int num = 0
- int q = 0;
- int n = 0;
- printf("enter the first element: \n");
- scanf("%d" , &num);
- printf("enter the series ratio: \n");
- scanf("%d" , &q);
- printf("enter number of the elements to display: \n");
- scanf("%d" , &n);
- }
- /*
- function that prints a number
- */
- void printnum(int num, q , n)
- {
- for(int i = 0; i<=n)
- {
- int result = num*pow(q,n);
- printf("%d" , result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement