运行结果:
C语言代码:
/* c how to program 习题3.41 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//分别定义变量半径,直径,周长,面积
float radius, pi = 3.14159;
//获取半径的值
printf("请输入圆的半径:", radius);
scanf("%f", &radius);
printf("\n圆的直径是:%.2f", radius * 2);
printf("\n圆的周长是:%.2f", radius * 2 * pi);
printf("\n圆的面积是:%.2f\n", radius * radius * pi);
}