title: Why does the Integer Type Conversion of sin^2(a)+cos^2(a) return 0 instead of 1?
body: <p>When I'm printing  sin(theta) * sin(theta)+ cos(theta)* cos(theta), it's coming out to be equal to 1.000000. But when I'm typecasting the same expression into int, the result comes out to be 0.</p>
  
  <pre><code> #include&lt; stdio.h &gt;
   #include&lt; math.h &gt;
   #define PI acos(-1)
   int main()
   {
       float theta;
       printf("Theta : ");
       scanf("%f",&amp;theta);
       theta=theta*PI/180;
       printf("%f\n",sin(theta)*sin(theta)+cos(theta)*cos(theta));
       printf("%d\n",(int)(sin(theta)*sin(theta)+cos(theta)*cos(theta)));
       return 0;
   }
  </code></pre>