The WP Debugging plugin must have a wp-config.php file that is writable by the filesystem.

C Program to Find Area of Circle

C Program to Find Area of Circle

In this blog, we are going to find the area of the circle, only provided the radius of the circle. Given a radius of the circle, we will deep dive and find the area of that circle in C. We all know how to find the area of a circle using a mathematical formula, but how to use that to build logic for solving in C is a quite complicated task. Let’s see a C program to find area of circle.

Everyone knows the basics of mathematics,
For finding the area of a circle, we can get this by performing some calculations area = pieradiusradius.

Formula
Area = Pie * Radius * Radius
Where value of pie = 3.14 and radius will be given by the user.

Algorithm for C Program to Find Area of Circle

  1. Enter the radius of the circle from the user.
  2. Initialize the value of pie with 3.14.
  3. Calculate the area of the circle with formula area = pieradiusradius.
  4. At last print the resultant i.e. area of the circle.

Code Implementation for C Program to Find Area of Circle

#include <stdio.h>
#include<conio.h>
int main() {
   float pie = 3.14;
   int radius;
   printf("Enter The Radius of Cicle:");
   scanf("%d",&radius);
   printf("The radius of the circle is %d\n" , radius);
   float area = (float)(pie* radius * radius);
   printf("The area of the given circle is %f", area);
   return 0;
}
Output
The radius of the circle is 10
The area of the given circle is 314.000000

Time Complexity

O(1) will be the time complexity for the c program to find area of circle as we are using only a mathematical formula for that.

Space Complexity

O(1) will be the space complexity as there is no extra space used for
solving c program
to find area of circle.

Conclusion

Hopefully, with the help of this blog, you will be able to write a c program to find area of circle. Solving the c program to find area of circle will help in building mathematical logics for the coding questions. There are many more questions in the coding world which require mathematical logic, practice daily to be efficient in your coding career.

Other C Programs
C program to calculate percentage of 5 subjects
C program to convert binary number to decimal number
C program to convert celsius to fahrenheit
C program to convert infix to postfix
C program to add two numbers
C program to find roots of quadratic equation
C program to reverse a number
C program for merge sort for linked lists
C program for performing bubble sort on linked list
C program to reverse a linked list

Leave a Reply

Your email address will not be published. Required fields are marked *