Contents
実数のサンプルパターン
[code lang=c]
#include <stdio.h>
void main(void) {
printf(縦3cm 横4cmの長方形の面積は%d平方センチです。\n, 3 * 4);
}
[/code]
実行結果
縦3cm 横4cmの長方形の面積は12平方センチです。
変数のサンプルパターン
[code lang=c]
#include <stdio.h>
void main(void) {
int tate = 3;
int yoko = 4;
printf(縦%dcm, 横%dcmの長方形の面積は%d平方センチです。\n, tate, yoko, tate * yoko);
}
[/code]
実行結果
縦3cm 横4cmの長方形の面積は12平方センチです。
コメントを残す