/******************************************* * tax.c * * 商品代を入力し消費税を出力 * ********************************************/ #include int main(void) { int price,tax; printf("商品代を入力してください\n"); scanf("%d",&price); tax=price/20; /* int型の除算なので小数点以下が切り捨てられる */ printf("消費税は%d円です。\n",tax); return 0; }