Check whether the given number is Cyclic Number or not.



#include <stdio.h>
#include <math.h>

void main() {
int num;
int save;
int temp;
int flag = 1;

printf("Enter number: ");
scanf("%d", &num);

save = num;
temp = pow(num,2);

while(num != 0) {
if(num%10 != temp%10) {
flag = 0;
break;
}
num = num/10;
temp = temp/10;
}

if(flag == 1) {
printf("%d is cyclic number", save);
}
else {
printf("%d is not cyclic number", save);
}

}