answersLogoWhite

0


Best Answer

pi x radius x radius the forula for working out the area of a circle if this is what you're asking.

========================================================

Please give the Proper Answer...

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

#include <iostream>

int main()

{

float width=0,height=0;

printf( " |.\n" );

printf( " | .\n" );

// "Answers.com formatting has removed multiple spaces from the following lines.

// Insert the indicated number of spaces to form a rectangle:

printf( " | .\n" ); // insert 1 extra space before period.

printf( " | .\n" ); // insert 2 extra spaces before period.

printf( "A | .\n" ); // insert 3 extra spaces before period.

printf( " | .\n" ); // insert 4 extra spaces before period.

printf( " | .\n" ); // insert 5 extra spaces before period.

printf( " | .\n" ); // insert 6 extra spaces before period.

printf( " ._________\n\n" ); // insert 5 extra spaces before B.

printf( " B\n\n" );

printf( "Enter size A: " );

scanf_s( "%f", &height );

printf( "Enter size B: " );

scanf_s( "%f", &width );

printf( "The area is %.2f units.\n", width * height * 0.5 );

return( 0 );

}

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

The area of a rectangle is calculated by multiplying the the length of its base by its height and then dividing by 2. Thus given the base and height of any triangle, the following function will calculate the area:

float areaof_triangle( float base, float height )

{

return( ( base * height ) / 2 );

}

Remember that a right-angled triangle is half a rectangle thus its area is half the area of the imagined rectangle, hence we divide the area of the rectangle (base times height) by two. The same principal applies to any triangle so long as the height is known. For a non-right angled triangle ABC, if the base is BC then the height is AB * sin(B). This calculates the length of an imagined line AD (the height), such that AD is perpendicular to AB, thus creating two right angled triangles of the same height. If the triangle ABC is isosceles, then AD (and BD) will be exactly half the length of AB, thus AD can then be calculated as the square root of AB2-AD2 (using Pythagoras' theorem).

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a c plus plus program to find area of a triangle where base4 and height6?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a pascal program that compute an area of a triangle?

{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 in qbasic to make a hut using print statemant?

a triangle then a square :)


Write a program that input a positive integer and prints a triangle using for loop?

write a program that reads in the size of the side of square and then pints a hollow square of that size out of asterisks and blanks?


How do you write a qbasic program to find area and circumerence of a circle?

Write a program that calculates the area of a triangle in QBASIC


How do you write a program to print numbers from star one and next line star two in php?

Try the triangle program on a search engine. Replace numbers with stars and that should do the trick


Can a write triangle be equilateral?

No


Write a C plus plus function that print a triangle of stars?

Write a function that print a triangle of stars.


How do you write a program for triangle pattern 1 3 5 7 5 7 9 11 7 9 11 13?

Use a text-editor.


How do you print a triangle of stars?

write a c++ programe to print a triangle without (for)


Can you write me a sentence using the word triangle?

He drew a triangle on his geometry test.


Write a menu driven program in java to find area of different shapes. 1. Circle 2. Triangle 3. Rectangle?

Remember that the area of a rectangle is width * height: static int getArea(Rectangle r) { return r.width * r.height; }


How to write program for secant method in mathematica?

How to write a program for secant method by mathematica