Can Somebody explain this?????????????????
program outputs :
4
1
Press Any Key...........
Code:double d_array[10] = {3.4, 12.8, 9.5, 2.0, 1.7, 3.8}; char letters[26]; int i; double j; int k; int l; for(i=0; i<1; ++i) { k=d_array[i]; j=d_array[i]-k; j*=10; cout<<j<<endl; l=j; cout<<(int)j%2<<endl; if((int)j%2==0) cout<<d_array[i]<<endl; }
Heres the question, why does the number when coverted from double to int result in 1?????
and not 4???????