Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- float x, p, step;
- int n = 1;
- scanf("%f", &x);
- scanf("%f", &p);
- step = p;
- while(x / step >= 1) {
- step *= p;
- n++;
- }
- printf("%d", n);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement