Header Ads Widget

C program to check whether a triangle is Equilateral, Isosceles or scalene based on the length of three sides

Here in this post we will write a program to check that a given triangle is equilateral , isosceles and scalene . the triangle which have all the sides are equal is known as equilateral , and the triangle which two sides are equal is known as isosceles triangle and the triangle which have all the different sides then it is called as scalene triangle. C program to check whether a triangle is Equilateral, Isosceles or scalene based on the length of three sides.

Code:-

#include<stdio.h>
int main()
{
int a,b,c;
printf("Enter value of sides : ");
scanf("%d%d%d",&a,&b,&c);
if(a==b && b==c)
printf("This is an equilateral triangle");
else if(a==b || a==c || b==c)
printf("This is an isosceles triangle");
else
printf("This is an Scalene triangle");
return 0;
}

Output:-
Enter value of sides : 50 50 41
This is an isosceles triangle


keywords:-

 ,write a program to check whether the triangle is equilateral isosceles or scalene triangle,

,write a program to check whether a triangle is equilateral isosceles or scalene in python,

,write a java program to check whether the triangle is equilateral isosceles or scalene triangle,

,flowchart to input three sides of a triangle and print if it is scalene isosceles or equilateral,

,check whether the triangle is isosceles equilateral scalene or right angled triangle,

,write a c program to input all sides of a triangle and check whether triangle is valid or not,

,write ac program to input three sides of a triangle and check whether the triangle is valid or not,

,check whether the triangle is isosceles equilateral scalene or right angled triangle using switch,

,check whether the triangle is isosceles, equilateral, scalene or right angled triangle,

,write a c program to input all sides of a triangle and check whether triangle is valid or not.,

,write ac program to input three sides of a triangle and check whether the triangle is valid or not,

,check whether the triangle is isosceles equilateral, scalene or right angled triangle using switch,

,write a program to check whether the triangle is equilateral, isosceles or scalene triangle,

,write a program to check whether a triangle is equilateral, isosceles or scalene in python,



Recommended Post:

Full C course:-    

Key points:-

Cracking the coding interview:-

 Array and string:-

Tree and graph:-

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

 MCQs:-



Post a Comment

0 Comments