Skip to content · ⁨コンテンツへスキップ⁩

Use what it gives back · ⁨戻り値を使う⁩

English

Use what it gives back

double is written for you and returns a number. Call it with 21 and store the answer in answer.

return hands a value back to whoever called the function. That value is not printed — you catch it with =, exactly like any other result.

日本語

戻り値を使う

doubleはすでに書かれており、数字を返します。21を引数として呼び出し、答えをanswerに格納します。

returnは関数を呼び出した側へ値を返します。その値は直接表示されませんが、=で受け取ります。他の結果と同じように扱います。

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP