Program :
/*
* This is a C program to Calculate
* the Area and Circumference of
* Circle
*
*
*
* 4_calculate_area_and_circumfrence_of_circle.c
*
* Created on: Oct 20, 2014
* Author: Code2care.org
*/
#include <stdio.h>
//#include <conio.h>
void main() {
int radius;
static float PI = 3.142;
float area;
float circumfrence;
// clrscr();
printf("Program to calculate Area and Circumference of Circle : \n\n");
printf("Enter the radius of Circle : ");
scanf("%d", &radius);
area = PI*radius*radius;
circumfrence = 2*PI*radius;
printf("\n\nArea of circle with radius %d = %f \n\n",radius,area);
printf("Circumference of circle with radius %d = %f \n\n",radius,circumfrence);
// getch();
}
-
Output :
Program to calculate Area and Circumference of Circle :
Enter the radius of Circle : 5
Area of circle with radius 5 = 78.550003
Circumference of circle with radius 5 = 31.420000
The best way to learn C programming is to practice more and more of programs .
Code2care C Programming tutorials provide 1000+ programs in C that you can study and become an expert in the language. Programs are divided into categories depending upon type and complexity.
BSc. IT, BSc. Computer Science, BSc. IT, MSc. IT, MSc. Computer Science, MCA, BTech IT & BTech Engineers may find these programs very useful.