‘C’ program to calculate area and circumference of a circle

C File =>


/* Write a ‘C’ program to calculate area and circumference of a circle. */

#include<stdio.h>
#define PI 3.142
int main() 
{
     int r;
     printf("\n Enter radius : ");
     scanf("%d",&r);
     printf("\n Area of circle = %f",PI*r*r);
     printf("\n Circumference of circle : %f",2*PI*r);
   return 0;
}

Comments

Popular posts from this blog

Write a program to allocate memory dynamically for n integers. Accept the elements and calculate their sum and average

C program to accept names of n cities and search for city named “Pune”.