問題一覧
お問い合わせ
light_mode
dark_mode
残り時間:
00:00
速度:
0
文字/分
消費税計算 (C)
問題
消費税(10%)を計算して、合計金額を表示するプログラムです。
入力例
1000
出力例
商品価格: 1000円 消費税: 100円 合計金額: 1100円
スタート
参照コード
コピーはできません。自分でタイピングしてください。
#include <stdio.h> int main(int argc, const char *argv[]) { int price; float taxRate = 0.10; // 消費税率10% scanf("%d", &price); int taxAmount = price * taxRate; int totalPrice = price + taxAmount; printf("商品価格: %d円\n", price); printf("消費税: %d円\n", taxAmount); printf("合計金額: %d円\n", totalPrice); return 0; }
入力エリア
コンパイル&実行
3