While doing some code excercise, I observed unusual ouput caused by the sqrt funtion,
The code was,
#include<stdio.h>
#include<math.h>
int main()
{
double l,b,min_r,max_r;
int i;
scanf("%lf %lf",&b,&l);
printf("%lf %lf\n",sqrt(l*l+b*b),sqrt(b*b-l*l));
return(0);
}
Output:
4 5
6.403124 -nan
Why does this happenes.