For any circle with radius r, the area of the circle is given by,
Program:
#include<iostream.h>
#include<conio.h>
main()
{
float area,r,pi;
clrscr();
cout<<"Enter the value of radius";
cin>>r;
pi=3.14;
area=pi*pi*r;
cout<<"The area of the circle is "<<area;
getch();
}
Area of circle = π × r2
Program:
#include<iostream.h>
#include<conio.h>
main()
{
float area,r,pi;
clrscr();
cout<<"Enter the value of radius";
cin>>r;
pi=3.14;
area=pi*pi*r;
cout<<"The area of the circle is "<<area;
getch();
}
ReplyDeletenice article for beginners.thank you.
javacodegeeks
welookups