/* Checking for validity of Triangle when three sides are entered*/
#include<stdio.h>
#include<conio.h>
void main()
{
int s1,s2,s3,l,s;/*s1=side one s2=side two s3=side three l=large side s=sum*/
clrscr();
printf("\n Enter the three sides of triangle");
scanf("%d %d %d",&s1,&s2,&s3);
if(s1>s2)
{
if(s1>s3)
{
s=s2+s3;
l=s1;
}
else
{
s=s1+s2;
l=s3;
}
}
else
{
if(s2>s3)
{
s=s1+s3;
l=s2;
}
else
{
s=s1+s2;
l=s3;
}
}
if(s>l)
printf("\n The triangle is valid");
else
printf("\n The triangle is invalid");
printf("\n Press any key to exit");
getch();
}