Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- float x,e;
- printf("Enter the x: ");
- scanf("%f",&x);
- printf("Enter the e: ");
- scanf("%f",&e);
- float n = x;
- float npr = 0;
- int i=1;
- while(n-npr<=e){
- printf("%d : %f\n",i,n);
- npr=n;
- i++;
- n = pow(x,i);
- }
- printf("first i: %d\n",i);
- printf("first n: %f\n",n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement