c program to find a circles area with radius given by user




This C programming tutorial we explain simple C program which explains how to find the area of a circle, given the radius.

         Here in this c program we uses three header files and defines the value of pie.


We initialize two float variables, ask the users to enter the value of radius. float datatype can have decimal values


Then we use the formula area = PI * pow (radius,2) to find the area of circle using c programming.

===================================================================
#include <stdio.h>
 
#include <conio.h>
 
#include <math.h>
 
#define PI 3.142
 
void main()
 
{
 
	float radius, area;
 
	clrscr();
 
   printf("Enter the radius of a circle\n");
 
	scanf ("%f", &radius);
 
	area = PI * pow (radius,2);
 
	printf ("Area of a circle = %5.2f\n", area);
 
}
==================================================================
OUTPUT of Computer C program to find area - circle
==================================================================
RUN1
Enter the radius of a circle
3.2
Area of a circle = 32.17

RUN 2
Enter the radius of a circle
6
Area of a circle = 113.11