#include <stdio.h>
#include <stdbool.h>
#include <math.h>
bool is_perfect_square(double n) {
double sq = sqrt(n);
return ((sq - floor(sq)) == 0);
}
int main()
{
int array[] = {7, 8, 9, 0, 36};
int len = sizeof(array)/sizeof(array[0]);
for (int i = 0; i < len; i++) {
if (is_perfect_square(array[i]))
printf("%d : Yes\n", array[i]);
else
printf("%d : No\n", array[i]);
}
return 0;
}
/*
run:
7 : No
8 : No
9 : Yes
0 : Yes
36 : Yes
*/