Â
In this, we are going to see how to find Area of Quarter-Circle using C++ program.
The formula to calculate is,
Area of Quarter-Circle = (π * radius * radius)/4Â
The Code given below can be used in Turbo C++ Compiler.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float area, radius, pi=3.142;
cout<<"This program is for Area of Quarter-circle\n";
cout<<"Enter the radius of the Quarter-circle\n";
cin>>radius;
//formula for area of Quarter-circle is (Ï€*radius*radius)/4
area = (pi*radius*radius)/4;
cout<<"The Area of the Quarter-circle with radius "<<radius<<" is = "<<area<<" sq units";
getch();
}
The Code given below can be used in g++/gcc Compiler.
#include<iostream>
using namespace std;
int main()
{
float area, radius, pi=3.142;
cout<<"This program is for Area of Quarter-circle\n";
cout<<"Enter the radius of the Quarter-circle\n";
cin>>radius;
//formula for area of Quarter-circle is (Ï€*radius*radius)/4
area = (pi*radius*radius)/4;
cout<<"The Area of the Quarter-circle with radius "<<radius<<" is = "<<area<<" sq units";
return 0;
}
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP