Advertisement
Abir_Ahsan

Untitled

Jul 11th, 2018
105
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. #include<math.h>
  3.  
  4. #define PI 3.14159265
  5.  
  6. int main()
  7. {
  8. int a,b,c;
  9. double A,B,C,val,ret1,ret2,ret3;
  10.  
  11. val=PI/180;
  12.  
  13. printf("Enter Length of Three Sides of a Triangle\n");
  14. scanf("%d%d%d", &a, &b, &c);
  15.  
  16. printf("Enter ANGELS of a Triangle\n");
  17. scanf("%lf%lf%lf", &A, &B, &C);
  18.  
  19. ret1= sin(A*val);
  20. ret2= sin(B*val);
  21. ret3= sin(C*val);
  22.  
  23.  
  24.  
  25. if( (a+ b > c) && (b + c > a) && (c + a > b) )
  26. {
  27. if((A+B+C)==180 && A!=0 && B!=0 && C!=0)
  28. {
  29. if( ( (double)a/ret1) == ( (double)b/ret2 ) && ( (double)b/ret2) == ( (double)c/ret3 ) )
  30. {
  31.  
  32. printf("The Triangle Is Valid !! ");
  33. }
  34.  
  35.  
  36. }
  37.  
  38. }
  39.  
  40.  
  41. else
  42. {
  43. printf("It is an invalid Triangle");
  44. }
  45.  
  46. return 0;
  47.  
  48. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement