私のプログラムを実行すると、次のようにすべての「cout(s)」が 1 行に表示されます。
私のプログラムを素敵にするために、それらを行ごとに表示したいのですが! 次のように表示したい:
Circumference of the circle: (This)
Diameter of the circle: (This)
Area of the circle: (This)
私のプログラムを実行すると、次のようにすべての「cout(s)」が 1 行に表示されます。
私のプログラムを素敵にするために、それらを行ごとに表示したいのですが! 次のように表示したい:
Circumference of the circle: (This)
Diameter of the circle: (This)
Area of the circle: (This)
endl
またはを使用\n
:
cout<<"Circumference of the circle:"<<your_value<<endl;
また
cout<<"Circumference of the circle:"<<your_value<<"\n";
改行が必要な場所に改行文字 ( で記述\n
) を印刷するだけです。C:
printf("The value: %d\n", value);
または C++ の場合:
cout << "The value: " << value << "\n";