TYPE OF TRIANGLE
Code :
#include<stdio.h>
int main()
{
int angle1 = 0, angle2 = 0, angle3 = 0;
printf("=========================================\n");
printf("\t TRIANGLE FAMILY\n");
printf("=========================================\n");
printf("Enter angles of Triangle...\n");
printf("Angle 1 : ");
scanf("%d", &angle1);
printf("Angle 2 : ");
scanf("%d", &angle2);
printf("Angle 3 : ");
scanf("%d", &angle3);
printf("\n");
if(angle1 == 60 && angle2 == 60 && angle3 == 60)
{
printf("Equilateral Triangle.\n");
}
else if(angle1 == angle2 || angle1 == angle3 || angle2 == angle3)
{
printf("Isosceles Triangle.\n");
}
else
{
printf("Scalene Triangle.\n");
}
printf("-----------------------------------------\n");
return 0;
}
Come again Learn again !
« iCodeBuzz »
No comments:
Post a Comment