π = 3.14159
/*Program to compute circle diameter,circumference, and area from radius*/ #include<stdio.h> #define PI 3.14159 int main(){ float radius; printf("Enter the radius of your circle: "); scanf("%f",&radius); printf("The diameter of your circle is %.2f\n",radius * 2); printf("The circumference of your circle is %.2f\n",2 * PI * radius); printf("The area of your circle is %.2f\n",PI * radius * 2); system("pause"); return 0; }
No comments:
Post a Comment