#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();
}
#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
enter the radius:5
the area of the circle of radius 5.000000 is 78.539749
0 comments:
Post a Comment