Check whether the triangle is an equilateral, isosceles, or scalene triangle with C language
#include <stdio.h>
int main()
{
int x, y, z;
printf("Enter three values of triangle: ");
scanf("%d%d%d", &x, &y, &z);
if (x == y && y == z)
{
printf("Equilateral triangle.");
}
else if (x == y || x == z || y == z)
{
printf("Isosceles triangle.");
}
else
{
printf("Scalene triangle.");
}
return 0;
}
Output:-
Enter three values of triangle : 4 5 6
Scalene triangle.
0 Comments