#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
printf("Enter the length of the sides of the triangle: ");
scanf("%d%d%d",&a,&b,&c);
if( (a+b <= c) || (b+c <= a) || (c+a <= b) )
printf("\nTriangle is invalid.");
else
printf("\nTriangle is valid.");
getch();
}
Output:
Please have a look at the below lesson posted on my YouTube channel:
#include<conio.h>
void main()
{
int a,b,c;
printf("Enter the length of the sides of the triangle: ");
scanf("%d%d%d",&a,&b,&c);
if( (a+b <= c) || (b+c <= a) || (c+a <= b) )
printf("\nTriangle is invalid.");
else
printf("\nTriangle is valid.");
getch();
}
Output:
Please have a look at the below lesson posted on my YouTube channel:
No comments:
Post a Comment