3.) PROGRAM TO CHECK THE TRIANGLE IS ISOSCELES, EQUILATERAL, SCANLENE ACCORDING THIER SIDES.

 

// Q3. PROGRAM TO CHECK THE TRIANGLE IS ISOSCELES,
EQUILATERAL, SCANLENE ACCORDING THIER SIDES.
#include <stdio.h>
#include <conio.h>

int main()
{
    int s1, s2, s3;
    printf("Enter the sides of the triangle :\n");
    scanf("%d%d%d", &s1, &s2, &s3);
    if ((s1 == s2 && s2 != s3) || (s2 == s3 && s3 != s1)
|| (s3 == s1 && s1 != s2))
    {
        printf("side of the triangle is %d, %d, %d is an
Isosceles Triangle\n", s1, s2, s3);
    }
    if (s1 == s2 && s2 == s3 && s3 == s1)
    {
        printf("side of the triangle is %d, %d, %d is an
Equilateral Triangle\n", s1, s2, s3);
    }
    if (s1 != s2 && s2 != s3 && s3 != s1)
    {
        printf("side of the triangle is %d, %d, %d is a
Scalene Triangle\n", s1, s2, s3);
    }
    return 0;
}

Output:
Enter the sides of the triangle : 7 8 6 side of the triangle is 7, 8, 6 is a Scalene Triangle
***** Thank You *****

Comments

Popular posts from this blog

18 Amazing programs in C.