asked 44.8k views
3 votes
Write a program in C that prompts the user to enter the radius of a circle, then computes and displays the area and circumference of the circle.

asked
User Brutasse
by
8.7k points

1 Answer

4 votes

Final answer:

This C program prompts the user for the radius of a circle, then calculates and displays its area and circumference.

Step-by-step explanation:

C Program to Calculate Area and Circumference of a Circle.To calculate the area and circumference of a circle, you can use the formula: Area = π * radius * radius Circumference= 2 * π * radius Here's an example program in C that prompts the user to enter the radius and then calculates and displays the area and circumference: #include<stdio.h> #define PI 3.14159 int main() { float radius, area, circumference; printf("Enter the radius of the circle: "); scanf("%f", &radius); area = PI * radius * radius; circumference = 2 * PI * radius; printf("Area of the circle: %.2f\\", area); printf("Circumference of the circle: %.2f\\", circumference); return 0;}

answered
User Subbu M
by
8.3k points