Skip to content

Instantly share code, notes, and snippets.

@hrshadhin
Created April 23, 2013 15:31
Show Gist options
  • Save hrshadhin/5444585 to your computer and use it in GitHub Desktop.
Save hrshadhin/5444585 to your computer and use it in GitHub Desktop.
Calculate area of the circle
#include<stdio.h>
int main()
{
double pi,radius,area;
pi = 3.1416;//define the value of pi
printf("Enter the radius of the circle in cm\n");
scanf("%lf",&radius);
area = pi * radius * radius;
printf("The Area of this circle is %.2f cm\n",area);
getch(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment