Answer to Question #254235 in C for Ammar

Question #254235

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


1
Expert's answer
2021-10-20T15:58:20-0400
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS