Jul 18, 2013 at 11:58am UTC
...
Last edited on Jul 18, 2013 at 1:50pm UTC
Jul 18, 2013 at 12:00pm UTC
What line?
Just FYI, converting from a double to an int effectively strips the number of its decimal place. That can lead to rounding errors, and eventually your result will be entirely wrong. If you need an accurate result, it will be wron anyway.
Last edited on Jul 18, 2013 at 12:01pm UTC
Jul 18, 2013 at 12:01pm UTC
sum=sum+a[j]*pow(2.0,k);
i think is here?? It showing this >>
warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
Jul 18, 2013 at 12:05pm UTC
but then why i cant get the output from calculation part??
i cant found any problem.. could you please tell me where am i get wrong?
Jul 18, 2013 at 12:07pm UTC
Im actually slightly confused...
nvm, i found it
Last edited on Jul 18, 2013 at 12:10pm UTC
Jul 18, 2013 at 12:12pm UTC
int a[10],i=0,number,sum=0,j,k=0;
??
Jul 18, 2013 at 12:12pm UTC
The problem isn't with the double to int problem, it just says that because you input a double (2.0) into the pow () function.
Your problem is somewhere else....