gcc编译器,该如何解决

gcc编译器
[june@localhost cfile]$ cat q.c 
#include <stdio.h>
#include <math.h>

int main()
{
int x = 24;
double y = 17;

printf("%d\n",8/* sqrt(x)*/);
printf("%d\n", sqrt(y));


}
[june@localhost cfile]$ gcc q.c -lm
[june@localhost cfile]$ ./a.out 
8
1722805511
[june@localhost cfile]$ 


------解决方案--------------------
sqrt返回值为浮点,用%f输出应该就没问题了