請教各位前輩下面這段程式:
#include <stdio.h>
int main()
{
long int salary=10800000;
float tax=0.48;
printf("年薪:\t%ld\n",salary);
printf("稅額:\t%f\n",salary*tax);
return 0;
}
執行結果:
年薪: 10800000
稅額: 5183999.884129
請問為什麼會這樣?哪裡錯了?感謝指教!
--
* Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3>