**C program to check valid triangle when sides are given using logical AND operator and conditional operator.**

**C program to check valid triangle when sides are given using logical AND operator and conditional operator**

#include <stdio.h>
int main()
{
int side1, side2, side3;
printf("\n Enter first side of triangle: ");
scanf("%d",&side1);
printf("\n Enter second side of triangle: ");
scanf("%d",&side2);
printf("\n Enter third side of triangle: ");
scanf("%d",&side3);
((side1 + side2 > side3) && (side1 + side3 > side2) && (side2 + side3 > side1))?
printf("Triangle is valid."):
printf("Triangle is not valid.");
return 0;
}

**Output:**

Enter first side of triangle: 4
Enter second side of triangle: 5
Enter third side of triangle: 3
Triangle is valid.
Enter first side of triangle: 5
Enter second side of triangle: 7
Enter third side of triangle: 8
Triangle is valid.
Enter first side of triangle: 1
Enter second side of triangle: 2
Enter third side of triangle: 3
Triangle is not valid.