其他分享
首页 > 其他分享> > 读入圆的半径,打印出直径,周长,面积

读入圆的半径,打印出直径,周长,面积

作者:互联网

//读入圆的半径,打印出直径,周长,面积
#include <stdio.h>

//function main begins program execution
int main(void)
{
double r;

printf("请输入圆的半径(小数点后六位):");
scanf("%lf",&r);

printf("圆的直径:%f\n",2*r);
printf("圆的周长:%f\n",2*3.14159*r);
printf("圆的面积:%f\n",3.14159*r*r); 

}//end function main

标签:function,周长,打印,3.14159,读入,printf,半径,main
来源: https://blog.csdn.net/s13253318528/article/details/100937197