...

Jul 18, 2013 at 11:58am
...
Last edited on Jul 18, 2013 at 1:50pm
Jul 18, 2013 at 12:00pm
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
Jul 18, 2013 at 12:01pm
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:02pm
line 112?
Jul 18, 2013 at 12:05pm
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
Im actually slightly confused...
nvm, i found it
Last edited on Jul 18, 2013 at 12:10pm
Jul 18, 2013 at 12:12pm
int a[10],i=0,number,sum=0,j,k=0;
??
Jul 18, 2013 at 12:12pm
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....
Topic archived. No new replies allowed.