Write a C program that takes in the radius (as in integer) of a circle from user and calculate and display the area of the circle
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
int main(){
const double PI = 3.1416;
double r;
double area;
printf("Enter a radius of a circle: ");
scanf("%lf",&r);
area = PI * r * r;
printf("The area of a circle: %.2f\n",area);
getchar();
getchar();
return 0;
}
Comments
Leave a comment