Sunday, May 5, 2013

Program to find the radious of a circle Using C language


#include<stdio.h>
#include<conio.h>
void main()
{
 float a,pi,r;
 clrscr();
 printf("enter the radius:");
 scanf("%f",&r);
 pi=3.14159;
 if(r>=0)
 {
  a=pi*r*r;
  printf("the area of the circle of radius %f is %f",r,a);
 }
  else
  {
   printf("negative values are not permitted:");
  }
  getch();
}
 
output

enter the radius:5
the area of the circle of radius 5.000000 is 78.539749

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More