Â
In this, we are going to see how to find Total Surface Area of Hemisphere using C++ program.
The formula to calculate is,
Total Surface Area of Hemisphere = 3 * π * radius * radiusÂ
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 Total Surface Area of Hemisphere\n";
cout<<"Enter the radius of the Hemi-sphere\n";
cin>>radius;
//formula for Total Surface Area of Hemisphere is 3*Ï€*radius*radius
area = 3*pi*radius*radius;
cout<<"The Total Surface Area of Hemisphere 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 Total Surface Area of Hemisphere\n";
cout<<"Enter the radius of the Hemi-sphere\n";
cin>>radius;
//formula for Total Surface Area of Hemisphere is 3*Ï€*radius*radius
area = 3*pi*radius*radius;
cout<<"The Total Surface Area of Hemisphere 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