Language:EN
Pages: 3
Words: 501
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
step by step answers with explanation

Calculate area of triangle Assignment Answers Needed

Your Question:

student submitted image, transcription available below

P2_5a.c One of the formulas to calculate the area of a triangle is:

Where b and c are any two sides and a is the angle formed by these two sides.

The area of the triangle = 23.94 sq cm

Step By Step Answers with Explanation

Sure, here is a step-by-step explanation of the C program to calculate the area of a triangle given two sides and the included angle:

Step 2: Declare variables

The program declares three variables: side1, side2, and angle. These variables will store the lengths of the two sides of the triangle and the included angle, respectively. The variables are declared as float type to accommodate decimal values.

C

printf("Enter the 2 sides of the triangle in cm: ");

printf("Enter the included angle in degrees): ");

scanf("%f", &angle);

The constant M_PI represents the value of pi, which is approximately 3.14159. The division by 180 converts the angle from degrees to radians.

Step 6: Calculate the area of the triangle

Step 7: Display the area of the triangle

The program uses the printf() function to display the calculated area of the triangle. The format specifier %f indicates that the output should be formatted as a floating-point number, and the sq cm indicates that the area is measured in square centimeters.

C

return 0;

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Shelia Swanson

PageId: DOC5B9E400