- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Environmental Science
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to find area and circumference of circle using C Programming
C Program to find area and circumference of circle
#include <stdio.h>
int main() {
int rad;
float PI = 3.14, area, ci;
printf("\nEnter radius of circle: ");
scanf("%d", &rad);
area = PI * rad * rad;
printf("\nArea of circle : %f ", area);
ci = 2 * PI * rad;
printf("\nCircumference : %f ", ci);
return (0);
}
Output :
Enter radius of a circle : 1
Area of circle : 3.14
Circumference : 6.28
Explanation of Program :
In this program we have to calculate the area and circumference of the circle. We have following 2 formulas for finding circumference and area of circle.
Area of Circle = PI * R * R
And
Circumference of Circle = 2 * PI * R
In the above program we have declared the floating point variable PI whose value is defaulted to 3.14.We are accepting the radius from user.
printf("\nEnter radius of circle: ");
scanf("%d", &rad);
- Related Questions & Answers
- How to Solve Second Order Quadratic Equation Using C Program
- How to calculate gross salary of a person using C Program
- How to reverse a given number using C
- How to convert temperature from degree centigrade to Fahrenheit using C
- How to reads customer number and power consumed and prints amount to be paid using C
- How to Calculate Area of Equilatral Triangle using C Language
- How to check the type of triangle using C
- How to calculate sum of 5 subjects and find percentage Using C Program
- How to find area and circumference of circle using C Programming
- Write a C program using pointers to read in an array of integers and print its elements in reverse order.
- How to Calculate Area of Rectangle using C Program
- How to find gretest in 3 number using C Programming
- Write C Program to Find Largest Element in Array in C Programming
- How to Calculate Area of Circle using C Programming
- Find Second largest element in an array using C Programming
- Write C program to find Exponent Power Series
Advertisements
ads