Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

C program to check whether the triangle is right angled triangle

 c Program to check whether the Triangle is right angled triangle

  • To check right angle triangle or not first we need to check sum of all three angles 
  • If sum of all three angles is 180 then we it should satisfy second condition also
  • Second condition is on of the angle should be 90.
  • if both the conditions are passed then we can say it is a right angle triangle.
  • Now lets write a c program to check triangle is right angle triangle or not.


  1. #include
  2. // write a c program too check traingle is right angle triasngle or not
  3. //www.instanceofjava.com
  4. int main()
  5. {
  6.      int angle1,angle2,angle3;
  7.      printf("Enter Three Angles of Triangle");
  8.      printf("\n-------------------------------\n");
  9.      printf("Enter Angle1  : ");
  10.      scanf("%d", &angle1);
  11.      printf("\nEnter  Angle2 : ");
  12.      scanf("%d",&angle2);
  13.      printf("\nEnter  Angle2  : ");
  14.      scanf("%d",&angle3);
  15.      printf("--------------------------------\n");
  16.      if(angle1+angle2+angle3==180) 
  17.      {
  18.          
  19.           if(angle1==90 || angle2==90 || angle3==90)
  20.           {
  21.                printf("\nTriangle is Right Angle Triangle\n"); //
  22.           }
  23.          
  24.      }
  25.      else
  26.      {
  27.           printf("\nIts Not a Triangle ");
  28.      }
  29.     getch();
  30. }




This post first appeared on Java Tutorial - InstanceOfJava, please read the originial post: here

Share the post

C program to check whether the triangle is right angled triangle

×

Subscribe to Java Tutorial - Instanceofjava

Get updates delivered right to your inbox!

Thank you for your subscription

×