Moving Coins

Description:

A triangle can be classified based on the lengths of its sides as equilateral, isosceles or scalene. All 3 sides of an equilateral triangle have the same length. An isosceles triangle has two sides that are the same length, and a third side that is a different length. If all of the sides have different lengths then the triangle is scalene. Write a program that reads the lengths of 3 sides of a triangle from the user. Display a message indicating the type of the triangle. Test Case 1 Input (stdin) 120 60 60 Expected Output isosceles Test Case 2 Input (stdin) 60 60 60 Expected Output equilateral

Program :


#include <stdio.h>


int main()

{

    int side1, side2, side3;

    scanf("%d%d%d", &side1, &side2, &side3);


    if(side1==side2 && side2==side3)

    {

        printf("equilateral");

    }

    else if(side1==side2 || side1==side3 || side2==side3)

    {

        printf("isosceles");

    }

    else

    {

        printf("scalene");

    }


    return 0;

}