-
Language
C
-
Description
It calculates the area of a circle using the formula: A = π * R²
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
int main (void)
{
float area, radius;
printf ("Enter the value of radius: ");
scanf ("%f", &radius);
(void) getchar ();
area=M_PI*radius*radius;
printf ("Value of area: %g\n", area);
putchar ('\n');
system ("pause");
return EXIT_SUCCESS;
}
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
int main (void)
{
float area, radius;
printf ("Enter the value of radius: ");
scanf ("%f", &radius);
(void) getchar ();
area=M_PI*radius*radius;
printf ("Value of area: %g\n", area);
putchar ('\n');
system ("pause");
return EXIT_SUCCESS;
}