Question

The program should be in C programming

The law of sines is an equation relating the lengths of the sides of an arbitrary triangle to the sines of its angles. Such t

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please find the answer below.
Please do comments in case of any issue. Also, don't forget to rate the question. Thank You.

code.c

#include<stdio.h>
#include<math.h>


void findC(float a,float b,float lenA){
   float angleC = 180-a-b;
   float radianChanger = 3.14/180;
   printf("The value of angle c is : %.2f\n",angleC);
   float lenC = sin(angleC*radianChanger)*lenA/sin(a*radianChanger);
   printf("The value of length c is : %.2f\n",lenC);
}

int main(){
   float angleA,angleB,angleC;
   float lengthA,lengthB,lengthC;
   printf("Enter value of angle a : ");
   scanf("%f",&angleA);

   printf("Enter value of angle b : ");
   scanf("%f",&angleB);


   printf("Enter value of length A : ");
   scanf("%f",&lengthA);

   if(angleA<0 || angleB<0 || lengthA<0){
       printf("Error!!! Please enter positive values for the parameters....");
   }else if(180<=(angleA+angleB)){
       printf("Error!!! Please enter valid angle values");
   }else{
       findC(angleA,angleB,lengthA);
   }


   return 0;
}

K:\WORKSPACE\c_language_workspace\C\ui.exe Enter value of angle a : -12 Enter value of angle b : 23 Enter value of length A :

K:\WORKSPACE\c_language_workspace\C\ui.exe Enter value of angle a : 100 Enter value of angle b : 200 Enter value of length A

K:\WORKSPACE\c_language_workspace\C\ui.exe Enter value of angle a : 20 Enter value of angle b : 30 Enter value of length A :

Add a comment
Know the answer?
Add Answer to:
The program should be in C programming The law of sines is an equation relating the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a C++ program to analyze a variety of triangles. The program should determine all angles...

    Write a C++ program to analyze a variety of triangles. The program should determine all angles and all sides for a triangle for three different options (give the user a menu of choices): 1) Given two sides and the angle between 2) Given two angles and one side 3) Given three sides More details for each option is provided below. Option 1: Given two sides and the angle between First check to be sure that the three values entered are...

  • The only ideas that can be used include: area ABCI-RA2(A+B+C-lpi), the Pythagorean theorem: Cos c cos a cos b. Vectors-dot product cross product, sin A-sin a/sin c; cos A-cos a sin b/sin c; spher...

    The only ideas that can be used include: area ABCI-RA2(A+B+C-lpi), the Pythagorean theorem: Cos c cos a cos b. Vectors-dot product cross product, sin A-sin a/sin c; cos A-cos a sin b/sin c; spherical law of sines, spherical law of cosines for sides and spherical law of cosines for angles Let r be the radius of the incircle of triangle ABC on the unit sphere S. If all the angles in triangle ABC are right angles, what is the exact...

  • 2. Write a program that prompts a user to enter the lengths of sides and angles...

    2. Write a program that prompts a user to enter the lengths of sides and angles for the two triangles described below. The program should calculate the length of the side of the triangle indicated below. Print the two answers to 3 decimal places onto the console screen Triangle 1 Read in the value of the angle, alpha, and the length, a, of the side indicated in the picture below. Calculate the length of the hypotenuse, c, of this right...

  • Use the Law of Sines to find the indicated side x. (Assume a = 17. Round...

    Use the Law of Sines to find the indicated side x. (Assume a = 17. Round your answer to one decimal place.) x = A 37.5 Need Help? Read It Master It Talk to a Tutor -/1 points v SPRECALC7 6.5.006. Use the Law of Sines to find the indicated angle 0. (Assume C = 62°. Round your answer to one decimal place.) eB 80.2 Need Help? Read It Talk to a Tutor -/3 points v SPRECALC7 6.5.009. Solve the...

  • Problem a (PA4a.java) Write a program to evaluate the area of a triangle given the lengths...

    Problem a (PA4a.java) Write a program to evaluate the area of a triangle given the lengths of its sides using Heron's Formula. Here is an outline: Get the three side lengths from the user (which might have decimal values): a, b, c. Check to ensure that the sides are valid for a triangle. Importantly, the sum of the lengths of any two sides must be larger than the length of the third side (you must check all three sides this...

  • Write a program to compute the area of a triangle using side-angle-side method and reports the...

    Write a program to compute the area of a triangle using side-angle-side method and reports the area of that triangle (rounded to 2 decimal places). Side-angle-side formula: ???? = 1/ 2 ?? sin(?), where a and b are two sides of the triangle, and C is the included angle. Your program must meet the following criteria to receive full marks: • Randomly generate two values between 5 and 10 (inclusive) for two sides a and b of the triangle, respectively....

  • C code. Write a program to find all the triangles with integer side lengths and a...

    C code. Write a program to find all the triangles with integer side lengths and a user specified perimeter. Perimeter is the sum of all the sides of the triangle. Integers a, b and c form a triangle if the sum of the lengths of any two sides is greater than the third side. Your program should find all the triples a, b and c where a + b + c is user specified perimeter value. Print each triple only...

  • Write a C++ program using user defined functions that will read in the lengths of two...

    Write a C++ program using user defined functions that will read in the lengths of two side of a right triangle and then calculate the length of the hypotenuse. The program should do this twice. The program should the following user defined functions: Function readA will read in a value for side A from the user and return it to main. (it will not receive any input data from main) Function readB will read in a value for side B...

  • programming in Microsoft visual studio. Write a C++ program for the following algorithm. Compile, run, and...

    programming in Microsoft visual studio. Write a C++ program for the following algorithm. Compile, run, and verify the result by choosing some test data. Prompt user to write X1 value in double Read X1 Prompt user to write X2 value in double Read X2 Prompt user to write Y1 value in double Read Y1 Prompt user to write Y2 value in double Read Y2 Compute the lengths of the two sides of the right triangle generated by the two points...

  • C++ programming For this assignment, write a program that will act as a geometry calculator. The...

    C++ programming For this assignment, write a program that will act as a geometry calculator. The program will be menu-driven and should continue to execute as long as the user wants to continue. Basic Program Logic The program should start by displaying a menu similar to the following: Geometry Calculator 1. Calculate the area of a circle 2. Calculate the area of a triangle 3. Quit Enter your choice(1-3): and get the user's choice as an integer. After the choice...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT