I am using Code Block with the GNU GCC compiler. And I'm trying to use this code
int number,temp;
printf("Enter a number :");
scanf("%d",&number);
temp = sqrt(number);
printf("\n%d",sqrt(number)); //print 987388755 -- > wrong result
printf("\n%d",temp); //print 3 -- > write result
return 0;
and in this code there is a result for input value 10
987388755
3
what's wrong with this code?
source
share