#include<stdio.h>
main(){
int i,x,y,last=1;
printf("Input x and y:\n");
scanf("%d %d",&x,&y);
for(i=1;i<=y;i++)
last=last*x%1000;
printf("The last three digits is:%d\n",last);
}
#include<stdio.h>
main(){
int i,x,y,last=1;
printf("Input x and y:\n");
scanf("%d %d",&x,&y);
for(i=1;i<=y;i++)
last=last*x%1000;
printf("The last three digits is:%d\n",last);
}