interface Shape {
public double getArea();
}
Write a c program to compute the surface area and volume of a cube
{A program to compute the area of a triangle} {by Ogboin W. Meshach} Var; b,h:real; BEGIN Writeln('Triangle'); Write('Base: '); Readln(base); Write('Height: '); Readln(height); area:=0.5*base*height; Writeln('Area: ', area :0:2); End.
Write a program that calculates the area of a triangle in QBASIC
calculating surface area
base times height just like a rectangle easy right
{Area s the area of cube} {Length is the length of one side of the cube} program AreaofCube; var Area,Length:real; begin write('Enter the length of cube: '); readln(Length); Area:=6*(Length*Length); writeln('The area of cube is ', Area, ' cm^2.'); end.
The equation for calculating the area of a circle is A r2, where A represents the area and r is the radius of the circle.
Rewrite the above program so that the program accepts any value for the radius then recalculate the area of the circle.
The base equation for calculating the area of a rectangle is length multiplied by width.
The formula for calculating the area of a circle is A r2, where A represents the area and r represents the radius of the circle.
Any of them. Calculating the area of a polygon is a relatively simple mathematical task.
Formula for calculating the area of sphere is : 4 * pi * r * r