C Program to Check Whether a Triangle is Equilateral, Isosceles or Scalene Triangle

C Program to Check Whether a Triangle is Equilateral, Isosceles or Scalene Triangle

Q:-Write aC Program to Check Whether a Triangle is Equilateral, Isosceles or Scalene Triangle

If the three sides of a Triangle are entered through the keyboard, write a program to check whether the Triangle is isosceles, equilateral, scalene Triangle.

Triangle consists of three sides and three angles. Based on the three sides, there are three types of triangle −

Equilateral triangle: All three sides are equal.
Isosceles triangle: All two sides are equal.
Scalene triangle: No sides are equal.

#include<stdio.h>
#include<conio.h>

void main() 
{
int side1, side2, side3;
 clrscr(); 

printf("Enter sides of triangle:");

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

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

printf("The Given Triangle is equilateral\n");

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

printf("The given Triangle is isosceles\n");

else

printf("The given Triangle is scalene\n");
getch();
 }

Output

TOP