#include<stdio.h>
#include<math.h>
int main()
{
int a, b, c;
clrscr();
printf("Enter the values of the sides of the triangle: \n");
scanf("%d %d %d", &a, &b, &c);
if ((a + b > c && a + c > b && b + c > a) && (a > 0 && b > 0 && c > 0))
{
if (a == b && b == c)
{
printf("Equilateral Triangle");
}
else if (a == b || b == c || a == c)
{
printf("Isosceles Triangle");
}
else
{
printf("Scalene Triangle");
}
}
else
{
printf("Triangle formation is not possible");
}
getch();
}
#include<math.h>
int main()
{
int a, b, c;
clrscr();
printf("Enter the values of the sides of the triangle: \n");
scanf("%d %d %d", &a, &b, &c);
if ((a + b > c && a + c > b && b + c > a) && (a > 0 && b > 0 && c > 0))
{
if (a == b && b == c)
{
printf("Equilateral Triangle");
}
else if (a == b || b == c || a == c)
{
printf("Isosceles Triangle");
}
else
{
printf("Scalene Triangle");
}
}
else
{
printf("Triangle formation is not possible");
}
getch();
}
No comments:
Post a Comment