Stuff
public text v1 · immutable#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int c;
int ewan(int y, int z){
int x = 1;
while(y > 0){
x = y * (int) pow(z, y % c);
y = y / c;
z = (int) pow(z, c);
}
return x;
}
main(){
int i, j, b, d;
printf("Enter z: ");
scanf("%d", &b);
printf("Enter c: ");
scanf("%d", &d);
c = d;
printf("\nc = %d\n", c);
for(i = 1; i <= 30; i++){
printf("ewan(%d, %d): \t%d\n", i, b, ewan(i, b));
}
}