Program To Check whether a Triangle is Equilateral , Isosceles or Scalene | C ++ program for the above approach ; Function to check if the triangle is equilateral or isosceles or scalene ; Check for equilateral triangle ; Check for isosceles triangle ; Otherwise scalene triangle ; Driver Code ; Given sides of triangle ; Function call
#include <bits/stdc++.h> NEW_LINE using namespace std ; void checkTriangle ( int x , int y , int z ) { if ( x == y && y == z ) cout << " Equilateral ▁ Triangle " ; else if ( x == y y == z z == x ) cout << " Isosceles ▁ Triangle " ; else cout << " Scalene ▁ Triangle " ; } int main ( ) { int x = 8 , y = 7 , z = 9 ; checkTriangle ( x , y , z ) ; }