Program to check a triangle is a equilateral, isosceles or scalene

Here is the program to check a triangle is equilateral, isosceles or scalene.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "conio.h"
#include "stdio.h"
 
void main()
{
  int x,y,z;
  printf("\nEnter the sides of a triangle");
  scanf("%d %d %d",&x,&y,&z);
  if((x==y) && (y==z))
  {
  printf("\nThe triangle is equilateral");
  } 
  else if((x==z) || (y==z) || (x==y))
  {
  printf("\nThe triangle is isoseles");
  }
  else
  {
  printf("\nThe triangle is scalene");
  }
getch();
}

Output:

Enter the sides of a triangle
12
10
12
 
The triangle is isoseles
Chitra
Chitra

2 thoughts on “Program to check a triangle is a equilateral, isosceles or scalene

  1. In 1st and 2nd line angle bracket will used surrounding sutdio.h or conio.h… these “” commas will not use.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest updates on your inbox

Be the first to receive the latest updates from Codesdoc by signing up to our email subscription.

    StudentProjects.in