forked from sanketpatil02/Code-Overflow
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckTriangle.cpp
More file actions
Latest commit
34 lines (24 loc) · 592 Bytes
/
Copy pathCheckTriangle.cpp
File metadata and controls
34 lines (24 loc) · 592 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include<bits/stdc++.h>
usingnamespacestd;
// Function to check if the triangle
// is equilateral or isosceles or scalene
voidcheckTriangle(int x, int y, int z)
{
// Check for equilateral triangle
if (x == y && y == z)
cout << "Equilateral Triangle";
// Check for isoceles triangle
elseif (x == y || y == z || z == x)
cout << "Isoceles Triangle";
// Otherwise scalene triangle
else
cout << "Scalene Triangle";
}
// Driver Code
intmain()
{
// Given sides of triangle
int x = 8, y = 7, z = 9;
// Function call
checkTriangle(x, y, z);
}