5. Write a C program to enter radius of a circle and find its diameter, circumference and area.
Solution :-
#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
float radius,area,circumference,diameter,pi=3.14;
printf("Enter the radius :-");
scanf("%f",&radius);
area =pi*radius*radius;
diameter = 2*radius;
circumference =2*pi*radius;
printf("The area of a circle :-%f\n",area);
printf("The diameter of a Circle :-%f\n",diameter);
printf("The Circumference of a Circle :- %f\n",circumference);
getch();
}
Output :-