Miscellany
public text v1 · immutable#include <stdio.h>
main()
{
int y, z, x, c, i, tempz;
printf("Enter c: ");
scanf("%d", &c);
while(1)
{
printf("Enter y: ");
scanf("%d", &y);
printf("Enter z: ");
scanf("%d", &z);
x = 1;
for( ; y > 0; y/=c)
{
tempz = 1;
if(y%c != 0)
{
for(i=0; i<y%c; i++)
tempz *= z;
}
x *= tempz;
tempz = 1;
for(i=0; i<c; i++)
tempz *= z;
z = tempz;
}
printf("Answer: %d.\n", x);
}
}