Download MetaTrader 5
To add comments, please log in or register
Your broker does not support mobile MetaTrader 5? Ask him to buy them!
Ricky Wen
4437
Ricky Wen 2014.02.28 14:32 

Hi, why code below output zero which is wrong?

double b=0;
b=30/100;
printf(b); //output zero wrong


and code below output is correct.

double b=0;

b=30.0/100.0;

printf(b); //output 0.3 correctly


Thanks.

Alain Verleyen
Moderator
28518
Alain Verleyen 2014.02.28 19:00  
Ricky Wen
4437
Ricky Wen 2014.03.01 11:55  
Thank you.
/
To add comments, please log in or register