This blog consists of C and C++ programs. C and C++ programming is the basics to learn any programming language. Most of the programs are provided with their respective outputs. This blog also contains Data Structures programs using Object-Oriented Programming (C++). Some of the best books for learning C and C++ programming are also mentioned.

Wednesday 4 September 2013

C++ program to find the Area of a Circle

For any circle with radius r, the area of the circle is given by,
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();
}

1 comment: